The moose likes JSF and the fly likes Tree structrue with dynamically loaded data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Tree structrue with dynamically loaded data" Watch "Tree structrue with dynamically loaded data" New topic

Tree structrue with dynamically loaded data

Janina Rebhan

Joined: May 09, 2008
Posts: 2

I need a tree structure that can render dynamically loaded data.

I tried richfaces' rich:tree and had a look at tomahawk's and tree2. I know that these two trees can dynamically display the nodes so that only the expanded nodes are send to the client. But after all the data needs to be loaded on the server at the beginning.
But what I need is that on expand of a node I can load the expanded data that needs to be displayed on the server at that time and not from the beginning.

The data I need to load needs too much time to be loaded by the server from the beginning. So I want it to be loaded when it needs to be displayed.

I got it working with rich:tree but it had side effects and didn't work as I needed it to ... The problem was that I don't know how I can get the information which node was expanded. I used [a4j:support event="onmousedown"] with a param to get this information but I think this had side effects too.

So, I hope you can help me with this one. I tried to get it to work for 3 days now

If anything is unclear just ask (I know that I explained it quite complicated ;) )

Greetz, Janina
Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
Check whether the below link can help you.


“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
Janina Rebhan

Joined: May 09, 2008
Posts: 2
Thanks for your answer but as i wrote before i tried rich:tree and it doesn't give me what i need. I need to load the data when it is requested. With rich:tree I have to load the data with the first rendering so that richfaces can then display only the data needed.
I know that there is adviseNodeOpened and changeExpandListener but both don't give you the information which node was clicked so i won't know which data to load.
Greetz, Janina
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Hi Janina,

Keep an eye on this one. Your answer might pop up there sometime today...

It is sorta covered in the JavaRanch Style Guide.
subject: Tree structrue with dynamically loaded data