-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I had already posted my question before. But didn't get any response. So, to be clearer, this is what I'm trying to achieve in zul file (I've written in java just to understand what I actually want to achieve in the UI)
I have the vLayout
already populated.
List<Groupbox> groupBoxList = vLayout.getChildren();
for (Groupbox groupBox : groupBoxList) {
// Display the Category name
System.out.println("=================================\n" + groupBox.getCaption().getLabel()
+ "\n=================================");
Listbox listBox = (Listbox) groupBox.getChildren().get(1);
ListModelList itemsList = (ListModelList) listBox.getModel();
List<CustomUserObject> users = itemsList.getInnerList();
for (CustomUserObject user : users) {
// Display the users under this category
System.out.println(studyUser.getFullName());
// if the iteration count exceeds 5, then break from this for loop and insert a label which, when on click, loads 5 more, retaining the already existing 5.
}
// label to be inserted here, which, onClick, loads 5 more users
}
Here is my attempt to achieve the same in zul file-
<zk forEach="${vLayout}">
<groupbox id="groupBox" mold="3d" style="top:470px;">
<caption label="${c:l('caption')}"
sclass="toggle_open">
<div id="arrowUser" />
</caption>
<listbox id="lboxUser" />
<div id="divMoreUsers" style="cursor: pointer; padding: 4px; background-color: rgb(224, 224, 224);">
<label id="lblMoreUsers" zclass="user_item_label_other" />
</div>
</groupbox>
</zk>
But I'm unable to display data in the UI. Any idea where I could be going wrong? Any suggestion is much appreciated.
Hello AlwaysALearner,
You have to update your zul configuration using as a reference the section Apply forEach to Multiple Elements from the url:
http://books.zkoss.org/wiki/ZKDeveloper%27sReference/UIComposing/ZUML/IterativeEvaluation
Specifically please check on the way the components are binded. For example:
<textbox value="${each.value}"/>
Finally please refer to the following url which includes a similar example on nested list boxes:
http://books.zkoss.org/wiki/ZKDeveloper%27sReference/MVC/View/Template/Listbox_Template
Best Regards,
Darksu
Asked: 2014-11-13 07:22:07 +0800
Seen: 54 times
Last updated: Nov 23 '14
LiveListboxDataLoader triggers an IndexOutOfBoundException
Listbox header and listcell not working fine in zk 7.0.1
bandbox click image custom action
ListCell textbox password getValue
textbox setValue unary operators
Listbox with multiple/checkmark=true not working
problem listbox index can't reload properly after addnew and remove data.??