ZK : Creatin listbox from arrayList
I am trying to make a l开发者_JAVA百科istbox from my two array. One of them has column names and the other list has inside two list that contains values.
I can set headers from string , but I cant separate values to list cells. It shows two list item but only one list cell. Like
HEADER 1 | HEADER 2 | HEADER 3
[1, 2, 0]
[1, 7, 0]
I should separate them . Here my .zul code
<listbox id="listModel"
mold="paging" pageSize="20" rows="20" selectedItem="@{mainCtrl.selected}">
<listhead forward="onDoubleClick=onRemoveFromHeader()">
<listheader label="${each}"
forEach="${comboModelColumns}" />
</listhead>
<listitem
label="${each}"
forEach="${listValues}">
</listitem>
</listbox>
In your case, you can use the listitem renderer to render the multiple cell, please refer to this guide.
Or you can use this way but not good for the nested forEach.
<listitem forEach="${firstLoop}">
<listcell forEach="${secondLoop}" .../>
</listitem>
This helped me
<listitem
forEach="${listValues}">
<listcell
forEach="${listValues[forEachStatus.index]}"
label="${each}" />
</listitem>
精彩评论