-
Bug
-
Resolution: Invalid
-
Normal
-
6.0.0
-
None
Tryed to use forEach and zkbind with no success. It looks like not compatible. I couldn't find any documentation. Maybe it is not possible or should I post it as a feature request? Sorry if I posted it wrong.
This is my code, it doesn't work:
<window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('TestVM')">
<zscript>
public class Bean {
String name;
public String getName()
public void setName(String name)
{ this.name = name; }}
public class TestVM {
public ArrayList list = new ArrayList();
public List getList()
public void setValue(ArrayList list)
{ this.list = list; }public TestVM()
{ Bean b1 = new Bean(); Bean b2 = new Bean(); Bean b3 = new Bean(); b1.setName("first"); b2.setName("second"); b3.setName("third"); list.add(b1); list.add(b2); list.add(b3); } }
</zscript>
<zk forEach="@load(vm.list)">
<vlayout>
<label value="@load(each.name)"/>
</vlayout>
</zk>
</window>