File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes <rich:tree> and database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "<rich:tree> and database" Watch "<rich:tree> and database" New topic
Author

<rich:tree> and database

Mladen Stupar
Greenhorn

Joined: Oct 14, 2009
Posts: 3
Is it possible to fill the <rich:tree> component nodes, with data from the database?

I have a table "Categories" in the database with two columns: "id_category" and "name_category". In treeBean class I have a method:
Below this I have "get" and "set" methods.

My JSF code for <rich:tree> component looks like this:
But this, in this way doesn't work. I get the following error message:
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

You can. I do. However, you can't simply point the tree at the data, you need a treemodel wrapper just like you need a databtable model wrapper. They both help maintain the UI-specific context.

Check the RichFaces docs. In recent releases, they added a way to easily wrap things such as domain model objects so you don't actually need to construct a tree-specific data model.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <rich:tree> and database