voyent
Tree Component Tutorial  XML
Forum Index -> General Help
Author Message
Andreh

Joined: 11/Dec/2006 00:00:00
Messages: 33
Offline


Tutorial -> http://facestutorials.icefaces.org/tutorial/tree-tutorial.html

I'm following the tutorial, but in the images doesn't appear the "+" on the tree node... But seeing the demo, it appears...

Demo -> http://facestutorials.icefaces.org/tree-basic-tutorial/

How can I fix this? not to show the "+" on the nodes...

gregory_m

Joined: 17/Jan/2005 00:00:00
Messages: 130
Offline


The Tree tutorial is slightly out-of-date. In the 1.5.0 release we modified the IceUserObject adding a new attribute "leaf". The TreeNodeRenderer uses this attribute to determine if a node should be rendered as a "leaf" or by default render a "folder".

To render leaf nodes (without +/-) call the setLeaf(true) method in the IceUserObject.

For example:
Code:
     // add some child nodes
     for (int i = 0; i <3; i++) {
         DefaultMutableTreeNode branchNode = new DefaultMutableTreeNode();
         IceUserObject branchObject = new IceUserObject(branchNode);
         branchObject.setText("node-" + i);
         
        [b] branchObject.setLeaf(true);[/b]
 
         branchNode.setUserObject(branchObject);
         rootTreeNode.add(branchNode);
     }
 


Thanks,

-- Greg --
Andreh

Joined: 11/Dec/2006 00:00:00
Messages: 33
Offline


Thanks!!

 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team