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

Tree node become leaf node after update

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 6.5.2
    • 6.5.1
    • Components
    • None

      <zk>
      	<zscript><![CDATA[
      	
      	DefaultTreeNode r = new DefaultTreeNode("root",new ArrayList());
      	DefaultTreeNode n1 = new DefaultTreeNode("Node 1",new ArrayList());
      	DefaultTreeNode n2 = new DefaultTreeNode("Node 2",new ArrayList());
      	DefaultTreeNode n3 = new DefaultTreeNode("Node 3",new ArrayList());
      	DefaultTreeNode n4 = new DefaultTreeNode("Node 4");
      	
      	r.add(n1);
      	n1.add(n2);
      	n2.add(n3);
      	n3.add(n4);
      	           
      	DefaultTreeModel model = new DefaultTreeModel(r);
      	model.addOpenObject(n1);
      	model.addOpenObject(n2);
      	model.addOpenObject(n3);
      	
      ]]></zscript>
      	<label multiline="true">
      		1.click on set Node2 Data, the node 2 label should change to New Node 2, and still has child Node3
      		2.if the bug is not fixed, Node 2 will become a Leaf Node. 
      	</label>
      	<button label="set Node2 Data" onClick='n2.setData("New Node 2")'/>
      	<tree model="${model}">
      		<treecols visible="false">
      			<treecol label="Unit"></treecol>
      		</treecols>
      		<template name="model">
      			<treeitem>
      				<treerow>
      					<treecell label="${each.data}"/>
      				</treerow>
      			</treeitem>
      		</template>
      	</tree>
      </zk>
      

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

              Created:
              Updated:
              Resolved: