aspose file tools*
The moose likes JSF and the fly likes Associating a DataTable for a node of a rich tree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Associating a DataTable for a node of a rich tree" Watch "Associating a DataTable for a node of a rich tree" New topic
Author

Associating a DataTable for a node of a rich tree

zul' Zorander
Greenhorn

Joined: Aug 12, 2009
Posts: 21
I need to associate a datatable for some nodes of a rich tree(not all the nodes). I tried enclosing a data table within rich:tree which obviously associated datatable for each node. I tried to associate a datatable within rich:treeNode and i no datatable is associated with the node. Can any one explain the reason behind this...........

Thanks
Zeddicus
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15624
    
  15

Unfortunately, the RichFaces tree is fairly limited in what types of elements can be made children of its nodes, though it isn't explicitly stated. I had major grief, in fact, just trying to get the node text to wrap and not slop outside of the display area.

Effectively, the RichFaces tree children have to be "outputText" types of items, not complex sub-controls.


Customer surveys are for companies who didn't pay proper attention to begin with.
zul' Zorander
Greenhorn

Joined: Aug 12, 2009
Posts: 21
Thanks a lot Tim
Actually my requirement is that some of the nodes of a tree has around 300 children which are leaf so I thought of putting all of them in a table under the parent node instead of displaying 300 nodes. So when creating a tree i can check for nodes which have more than 100 nodes and add all the children into an arraylist (which is a attribute of node type) and upon clicking the node i am displaying a table with all the elements of arrayList so user can choose elements from them. I am implemented this approach but I am not sure whether it delivers good performance......What do you think of this approach???

Thanks
Zeddicus
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15624
    
  15

Don't even bother. I have a 3-level tree that I tried to convert to a menu scheme. Every time the page refreshed, over 3MB of data came stampeding down the pipe, and even on a LAN, that was too big a hit.

You'd be better off tying a separate table display pane to the tree.
zul' Zorander
Greenhorn

Joined: Aug 12, 2009
Posts: 21
Sorry Tim I could not understand your answer completely (I am very new to RichFaces). I have many different ideas but dont know their performance. How can we find how much data is sent/recieved on each request. Since in my tree problem I am only using ajax requests doesn't it take lot less data to display table???
I also could not understand the meaning of "tying a separate table display pane to the tree". Is it attaching a table with each node of the tree? Because if I tried enclosing a dataTable within the richtree tags which produced a datatable for every node(obviously!) or associating a table on the click of node or selection of node??

Thanks
Zeddicus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Associating a DataTable for a node of a rich tree
 
Similar Threads
listening to events when Child node changes?
Adding an attribute to an element
Selecting multiple nodes from <rich:tree>
Rich Faces Tree working too slow
Setting selected node of a rich:tree dynamically