-
1. Re: How to build a RichTree or PanelMenu navigational sideBar?
endyamon Jun 20, 2008 1:11 AM (in response to luxspes)Hi,
I solved this problem by creating a seam component with scope session and then i defined a org.richfaces.component.UITree member with it's getter/setter. And my final step was to bind my rich:tree with this member.<rich:tree binding="myMenuComp.myUITree" />
One important thing. I had to move all my jar's file from MyApp.war/WEB-INF/lib to MyApp.ear/lib.
Regards,
-
2. Re: How to build a RichTree or PanelMenu navigational sideBar?
svetzal Jun 20, 2008 5:57 AM (in response to luxspes)
Francisco Peredo wrote on Jun 20, 2008 00:53:
How can I keep the state of the RichTree so that it loads in the same state it was in the previous page?My approach has been to use Ajax and make clicks in the RichTree refresh a separate content area, so the area of the page where the Tree lays is never actually refreshed.
-
3. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Jun 20, 2008 3:15 PM (in response to luxspes)Hi!
Steven Vetzal wrote on Jun 20, 2008 05:57:
My approach has been to use Ajax and make clicks in the RichTree refresh a separate content area, so the area of the page where the Tree lays is never actually refreshed.Yes, but that doesn't work if I do redirects (and in this case I need redirects).
-
4. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Jun 20, 2008 3:33 PM (in response to luxspes)Hi!
Roberson Ribeiro wrote on Jun 20, 2008 01:11:
Hi,
I solved this problem by creating a seam component with scope session and then i defined a org.richfaces.component.UITree member with it's getter/setter. And my final step was to bind my rich:tree with this member.<rich:tree binding="myMenuComp.myUITree" />
One important thing. I had to move all my jar's file from MyApp.war/WEB-INF/lib to MyApp.ear/lib.
Regards,
I tried that (and I was able to do it and keep my project as a WAR, not an EAR) but the problem is I had to store the org.richfaces.component.UITree at ScopeType.SESSION. I don't like the idea of storing the tree state in the SESSION, but I have been unable to store it in a temporary conversation...
Today I found in the docs Conversational components and JSF component bindings, I will try that and post here my results.
-
5. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Jun 20, 2008 4:01 PM (in response to luxspes)Hi!
It doesn't seem to work, if I bind the UITree to
#{menu.richTree.tree} (where menu ScopeType.CONVERSATIONAL, richTree ScopeType.EVENT with a property tree of type UITree ) it crashes as always (I see no advantage on the method described in Conversational components and JSF component bindings).08:56:53,984 ERROR [ExceptionFilter] exception root cause javax.el.PropertyNotFoundException: /layout/MenuDinamico.xhtml @12,93 binding="#{menu.richTree.tree}": Target Unreachable, identifier 'menu' resolved to null at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:95)
And if bind it to #{richTree.tree} it doesn't crash, but it doesn't remember the state of the tree.
Any suggested workarounds? (other than going back to ScopeType.SESSION)
Thanks,
Regards,
-
6. Re: How to build a RichTree or PanelMenu navigational sideBar?
endyamon Jun 20, 2008 4:46 PM (in response to luxspes)In my use case it's not a problem because the tree state represents a user session, pages he opens, that's why i use scope SESSION. And with scope conversation you'll gonna lose your tree state after beginning a new conversation.
-
7. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Jun 20, 2008 5:30 PM (in response to luxspes)Hi!
Roberson Ribeiro wrote on Jun 20, 2008 16:46:
In my use case it's not a problem because the tree state represents a user session, pages he opens, that's why i use scope SESSION.And what about support for multiple tabs (they are pretty popular around the world you know)?
And with scope conversation you'll gonna lose your tree state after beginning a new conversation.I was hoping that it could survive just until the next page gets rendered... I just want a sidebar like the one on RichFacesLiveDemo, but with a RichTree because AFAIK PanelMenu can not be loaded with recursive stuff in JPA POJOs (Am I wrong?)
Could this be solved differently? is there an alternative way to make the RichTree remember the currently selected node? (With @DataModel perhaps? Any hints? I can not find an example with RichTree and @DataModel anywhere).
-
8. Re: How to build a RichTree or PanelMenu navigational sideBar?
endyamon Jun 20, 2008 5:54 PM (in response to luxspes)Hi,
I'm using rich:tabPanel and works fine. Or what you mean with tabs? -
9. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Jun 20, 2008 6:31 PM (in response to luxspes)Hi!
Roberson Ribeiro wrote on Jun 20, 2008 17:54:
Hi,
I'm using rich:tabPanel and works fine. Or what you mean with tabs?I never mentioned rich:tabPanel, I am writing about rich:tree and rich:panelMenu, I don't see any the relation with this discussion and the rich:tabPanel.
-
10. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Jun 20, 2008 6:34 PM (in response to luxspes)Hi!
Roberson Ribeiro wrote on Jun 20, 2008 17:54:
Or what you mean with tabs?I mean this: Tabbed Browsing in Firefox
-
11. Re: How to build a RichTree or PanelMenu navigational sideBar?
endyamon Jun 20, 2008 6:55 PM (in response to luxspes)Oh! sorry, sorry!!
i'll make some tests, and comments later.
-
12. Re: How to build a RichTree or PanelMenu navigational sideBar?
philip142au.philip_andrew.hotmail.com Dec 17, 2008 11:49 AM (in response to luxspes)Hi,
Did you solve this problem?
I also want to do the same thing!
help!Thanks, Philip
-
13. Re: How to build a RichTree or PanelMenu navigational sideBar?
luxspes Dec 17, 2008 5:36 PM (in response to luxspes)Nop, had to use ScopeType.SESSION and get used to the fact that it is impossible to build a navigational sideBar that plays well with tabbed browsing.
I think this problem could be solved if I could save the state of the tree on a temp conversation to pass it to the next page and the re-render it in the exact way it was in the previous page.
Sadly, right now, it is impossible to control the expanded/collapsed state of the tree nodes from the bean model (but if could please vote for RF-4129 I'll be really nice of you)
Regards,
-
14. Re: How to build a RichTree or PanelMenu navigational sideBar?
joblini Dec 17, 2008 11:53 PM (in response to luxspes)I use the componentState attribute, bound to a bean in conversation scope, which works perfectly to remember the state of the tree. (Richfaces v3.2.2)
<rich:tree id="tree" switchType="ajax" omponentState="#{treeController.componentState}">