-
Bug
-
Resolution: Fixed
-
Normal
-
None
-
None
-
None
-
None
This issue may affect to all components who have model listener.
For example,
<zk> <zscript><![CDATA[ ListModelList mymodel = new ListModelList(); mymodel.add("aaa"); mymodel.add("bbb"); mymodel.add("ccc"); public class MyListbox extends Listbox { public void onInitRender() { super.onInitRender(); Clients.log("init " + this.getId()); } } ]]> </zscript> <label multiline="true"> 1. you should see "init list1" and "init list2" 2. click the "detach" button, you should see only "init list1" is added. 3. click the "attach" button, you should see "init list1" and "init list2" are added. and the content of both listbox are "abc" </label> <listbox id="list1" model="${mymodel}" use="MyListbox"> <template name="model"> <listitem> <listcell label="${each}" /> </listitem> </template> </listbox> <listbox id="list2" model="${mymodel}" use="MyListbox"> <template name="model"> <listitem> <listcell label="${each}" /> </listitem> </template> </listbox> <button label="detach"> <attribute name="onClick"> Component list2 = list2; list2.detach(); mymodel.clear(); mymodel.add("ddd"); mymodel.add("eee"); mymodel.add("fff"); </attribute> </button> <button label="attach"> <attribute name="onClick"> list2.setPage(self.getPage()); mymodel.clear(); mymodel.add("abc"); mymodel.add("abc"); mymodel.add("abc"); </attribute> </button> </zk>