This content has been marked as final.
Show 2 replies
-
1. Re: RichFaces tree from hierarchical query
nbelaevski Oct 18, 2009 2:56 PM (in response to kubap.) -
2. Re: RichFaces tree from hierarchical query
ahoehma Oct 19, 2009 10:17 AM (in response to kubap.)1. create a domain object class, i.e. Foobar with methods getParent(), getChildren() etc. Use JPA to define the releationship
2. create a "jsf bean" foobarTreeManager with method getRoots(), this manager can use a injected "FoobarDao" to load the hierarchical Foobar-structure:public List<Foobar> getRoots() { // use any method from your dao to get the (first) Foobar // without a parent .... return foobarDao.getRoot(); }
3. use rich:recursiveTreeNodesAdaptor<rich:recursiveTreeNodesAdaptor roots="#{foobarTreeManager.roots}" var="foobarNode" nodes="#{foobarNode.children}"> ... </rich:recursiveTreeNodesAdaptor>
Thats it :)