In following ZUL, the selector #lb > listitem should only match 2 components but 5.
selector.zul
<window id="win" width="600px" border="normal"> <listbox id="lb"> <listhead> <listheader label="row0" /> </listhead> <listitem> <listcell label="item0" /> </listitem> <listitem> <listcell label="item1" /> </listitem> </listbox> <separator /> <listbox id="nohead"> <listitem> <listcell label="i0" /> </listitem> <listitem> <listcell label="i1" /> </listitem> <listitem> <listcell label="i2" /> </listitem> </listbox> <separator /> <hbox>#lb listitem <label id="msg" /></hbox> <hbox>#lb > listitem <label id="msg2" /></hbox> <zscript><![CDATA[ List comps = org.zkoss.zk.ui.select.Selectors.find(page, "#lb listitem"); msg.setValue("" + comps.size()); comps = org.zkoss.zk.ui.select.Selectors.find(page, "#lb > listitem"); msg2.setValue("" + comps.size()); ]]></zscript> </window>
- duplicates
-
ZK-1741 Invalid components wiring using CSS3 selectors
- Closed