<zk>
<label multiline="true">
1.select on listbox, you will see the grid shows only one row as same as your selection
2.click add to add more new items.
3.select on the new item of the listbox, the new added item doesn't show on grid
</label>
<window title="CHT1" border="normal" hflex="1" vflex="1">
<zscript><![CDATA[
ListModelList model1 = new ListModelList();
model1.add("A");
model1.add("B");
model1.add("C");
ListModelList model2 = new ListModelList();
model2.add("A");
model2.add("B");
model2.add("C");
void doSelect(int index){
List children = grid1.getRows().getChildren();
for(int i=0;i<children.size();i++){
children.get(i).setVisible(i==index?true:false);
}
}
void doAdd(){
String str = ""+new Date();
model1.add(str);
model2.add(str);
}
]]></zscript>
<button label="add" onClick="doAdd()"/>
<listbox id="listbox1" model="${model1}" onSelect="doSelect(listbox1.getSelectedIndex())"></listbox>
<grid id="grid1" model="${model2}">
<template name="model">
<row visible="false">
<label value="${each}"></label>
</row>
</template>
</grid>
</window>
</zk>