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

The children size of client widget is incorrect for xhtml component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • None
    • 8.0.0
    • ZK Client Engine
    • None

      As title, the size of children differs in different situation.

      Sample 1: the size is 12

      <zk xmlns:x="xhtml" xmlns:n="native">
      	<x:ul id="container">
      		<forEach begin="1" end="10">
      			<n:li>
      				list-item
      			</n:li>
      		</forEach>
      	</x:ul>
      	<script><![CDATA[
      	zk.afterMount(function() {
      		var wgt = zk.Widget.$('$container');
      		zk.log(wgt.nChildren);
      	});
      	]]></script>
      </zk>
      

      Sample 2: the size is 10

      <zk xmlns:x="xhtml" xmlns:n="native">
      	<x:ul id="container"><forEach begin="1" end="10"><n:li>list-item</n:li></forEach>
      	</x:ul>
      	<script><![CDATA[
      	zk.afterMount(function() {
      		var wgt = zk.Widget.$('$container');
      		zk.log(wgt.nChildren);
      	});
      	]]></script>
      </zk>
      

      Sample 3: the size is 13

      <zk xmlns:x="xhtml" xmlns:n="native">
      	<x:ul id="container">
      		<x:li>list-item</x:li>
      		<x:li>list-item</x:li>
      		<x:li>list-item</x:li>
      		<x:li>list-item</x:li>
      		<x:li>list-item</x:li>
      		<x:li>list-item</x:li>
      	</x:ul>
      	<script><![CDATA[
      	zk.afterMount(function() {
      		var wgt = zk.Widget.$('$container');
      		zk.log(wgt.nChildren);
      	});
      	]]></script>
      </zk>
      

      Sample 4: the size is 7

      <zk xmlns:x="xhtml" xmlns:n="native">
      	<x:ul id="container">
      		<n:li>list-item</n:li>
      		<n:li>list-item</n:li>
      		<n:li>list-item</n:li>
      		<n:li>list-item</n:li>
      		<n:li>list-item</n:li>
      		<n:li>list-item</n:li>
      	</x:ul>
      	<script><![CDATA[
      	zk.afterMount(function() {
      		var wgt = zk.Widget.$('$container');
      		zk.log(wgt.nChildren);
      	});
      	]]></script>
      </zk>
      

            Unassigned Unassigned
            vincentjian vincentjian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: