-
1. Re: RichFaces 4 and keeping panelMenu state
siteburn Sep 20, 2011 8:41 AM (in response to siteburn)no solution or workaround for this problem?
at the richfaces-showcase-menu on http://richfaces-showcase.appspot.com/ is the expand state of the left menu save, but how? It's a dynamically created menu...
-
2. Re: RichFaces 4 and keeping panelMenu state
simkam Sep 20, 2011 8:59 AM (in response to siteburn)Hi,
you can look at showcase sources here: http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces-showcase/
also look at activeItem attribute of rich:panelMenu and expanded attribute of rich:panelMenuGroup
-
3. Re: RichFaces 4 and keeping panelMenu state
siteburn Sep 20, 2011 9:58 AM (in response to simkam)thanks for you answer.
i looked at the navigation.xhtml (template), but no expanded attribute at rich:panelMenuGroup, but a "activeItem" attribute at rich:panelMenu.
code of navigation.xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:c="http://java.sun.com/jsp/jstl/core"> <rich:panelMenu activeItem="#{demoNavigator.currentDemo.id}"> <c:forEach items="#{demoNavigator.groups}" var="gr"> <rich:panelMenuGroup label="#{gr.name}" rightExpandedIcon="#{gr.newItems ? '/images/icons/new-ic.gif' : null}" rightCollapsedIcon="#{gr.newItems ? '/images/icons/new-ic.gif' : null}"> <c:forEach items="#{gr.demos}" var="d"> <rich:panelMenuItem label="#{d.name}" action="#{d.id}" mode="client" name="#{d.id}" rightIcon="#{(d.newItems || gr.newItem) ? '/images/icons/new-small-ic.gif' : null}" onclick="document.location.href='#{facesContext.externalContext.requestContextPath}/richfaces/component-sample.jsf?demo=#{d.id}&skin=#{skinBean.skin}'"> </rich:panelMenuItem> </c:forEach> </rich:panelMenuGroup> </c:forEach> </rich:panelMenu> </ui:composition>
the navigation beans are there http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/
But i can't find or understand the right codesegment for saving the menu state. It's to complex for my application.
can you help me to find the right code?
thanks.
-
4. Re: RichFaces 4 and keeping panelMenu state
simkam Sep 20, 2011 3:28 PM (in response to siteburn)Just save active item in session scoped managed bean. PanelMenuGroup with active item will stay expanded. In theory, I can't try it now.