-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.1
-
None
-
None
If you use model bind, it works fine.
<zk> <zscript><![CDATA[ import java.util.Arrays; import java.util.List; import org.zkoss.bind.annotation.Init; public class MyData { private List list; public MyData(List list) { super(); this.list = list; } public List getList() { return list; } public void setList(List list) { this.list = list; } } public class TestVM { private MyData myData; public MyData getMyData() { if (myData == null) myData = new MyData(Arrays.asList(new String[]{"A","B","C"})); return myData; } } ]]></zscript> <window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('TestVM')"> <groupbox form="@id('prn') @load(vm.myData)" > <!-- <grid model="@load(prn.list)"> <columns> <column label="Sprache" /> </columns> <template name="model" var="item"> <row> <textbox value="@bind(item)" cols="2"> </textbox> </row> </template> </grid> --> <grid> <columns> <column label="Sprache" /> </columns> <rows children="@load(prn.list)"> <template name="children" var="item"> <row> <textbox value="@bind(item)" cols="2"> </textbox> </row> </template> </rows> </grid> </groupbox> </window> </zk>