Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1758

Selectors finds too many components when using CSS child selector

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.4
    • 6.0.0
    • General
    • None
    • None

      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>
      

            jumperchen jumperchen
            paowang paowang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: