Details
-
Bug
-
Resolution: Won't Fix
-
Normal
-
None
-
7.0.2
-
Security Level: Jimmy
-
None
Description
Reproducible sample
<zk> <label multiline="true"> 1. Click "clear" button. 2. Error message showed. 3. listbox also have this issue. </label> <zscript><![CDATA[ void clear() { profiles.getChildren().clear(); lb.getItems().clear(); } ]]></zscript> <grid> <columns> <column label="grid" /> </columns> <rows id="profiles"> <row stubonly="true" forEach="1,2,3,4,5,6">row ${each}</row> </rows> </grid> <listbox id="lb"> <listhead> <listheader label="listbox" /> </listhead> <listitem stubonly="true" forEach="1,2,3,4,5,6" label="listitem ${each}" /> </listbox> <button label="clear" onClick="clear()" /> </zk>
And the stacktrace
SEVERE: >>java.lang.ClassCastException: org.zkoss.zk.ui.sys.StubsComponent cannot be cast to org.zkoss.zul.Row
>> at org.zkoss.zul.Rows.beforeRemove(Rows.java:351)
>> at org.zkoss.zul.Rows.removeChild(Rows.java:299)
>> at org.zkoss.zk.ui.AbstractComponent$ChildIter.remove(AbstractComponent.java:2923)
>> at org.zkoss.zul.Rows$Children.removeRange(Rows.java:628)
>> at java.util.AbstractList.clear(Unknown Source)
>> at org.zkoss.zul.Rows$Children.clear(Rows.java:635)