Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tree in JSF.  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone tell me how to create a tree in JSF.
My other option is to create the same using Myfaces Trnindad.

But i could not find a working example for the same .

Also, my problem is that the tree is getting refreshed for every submit of the form(which is the need), however, i need to bring the tree in the same state as it was before submit. That is, for example, if the user has selected a tree node which is a child of many other tree nodes, then after submit , i need the same tree node to be selected and teh tree should be in the same expanded state as it was before submit.

Thankx in Advance.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried using richfaces.

Here is the demo
http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf

Here is the example code to keep the tree state across the request.
http://jboss.com/index.html?module=bb&op=viewtopic&t=126153
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create the tree using apache myfaces tomahawk library. It is very simple.
You can see the sample tree at http://www.irian.at/myfacesexamples/home.jsf
You can get the code sample at i.e MyFaces Tomahawk 1.1.6 Examples(tar.gz)
from http://myfaces.apache.org/download.html.

I hope this helps
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, about the refreshing problem.. There is a setting.

In tomahawk tree2 component the setting is called "preserveToggle" that you can set to true or false.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!