-
1. Re: Lazy loading rich tree
viggo.navarsete Aug 9, 2007 1:47 PM (in response to kewldude)I'am also interested in how to achive what kewldude describes.
-
2. Re: Lazy loading rich tree
jaydfwtx Aug 10, 2007 10:36 AM (in response to kewldude)Have you tried using the changeExpandListener to add new nodes to the tree as needed? For example, the simple case is you initially only have 2 levels loaded into the tree. When the user expands the 1st level, you add the 3rd level nodes to the subtree they expanded.
I am thinking I will eventually need lazy-loading also, and this is how I thought I would do it. -
3. Re: Lazy loading rich tree
ishabalov Aug 10, 2007 3:24 PM (in response to kewldude)Looks like another candidate for in-dept example :-)
As an idea - you need to implement your own TreeNode, that will perform all lazy loading. On top of this ypou need to use "ajax" expand/collapse.
You TreeNode implementation must do whatever you need to load current node and all it children till required dept. Whenever getChildren() called on any node you cal load actual child data.
As an example you can look at richfaces-demo code here:
http://anonsvn.jboss.org/repos/richfaces/trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java