1 Reply Latest reply on Sep 17, 2008 7:02 AM by Ilya Shaikovsky

    panelMenu: panelMenuGroup does not expand on selected items

    Raimund Hölle Newbie


      we are trying to use panelMenu as a navigation menu for our pages, similar to the Live Demo Site.

      So we need to keep the selected item between requests. Thats not difficult, we're using the following code:

       <rich:panelMenu id="#{mainMenu.menuId()}"
       selectedChild="#{mainMenu.currentItemId}" >
       <rich:panelMenuGroup name="g1" expanded="true" label="Group 1">
       <rich:panelMenuItem name="g1:i1" label="Item1"
       action="#{mainMenu.activateView('/testViewG1I1.xhtml','g1:i1')}" />
       <rich:panelMenuItem name="g1:i2" label="Item2"
       action="#{mainMenu.activateView('/testViewG1I2.xhtml','g1:i2')}" />
       <rich:panelMenuGroup name="g2" expanded="true" label="Group 2">
       <rich:panelMenuItem name="g2:i1" label="Item1"
       action="#{mainMenu.activateView('/testViewG2I1.xhtml','g2:i1')}" />

      "mainMenu" is a simple Component to track the current item:
      public class MainMenu {
       private String currentItemId;
       private static final String MENU_ID = "mainMenu";
       public String getMenuId() {
       return MENU_ID;
       public String activateView(String AViewName, String AItemId) {
       return AViewName;
       public String getCurrentId() {
       return currentItemId;
       public void setCurrentId( String ACurrentId ) {
       currentItemId = ACurrentId;

      Unfortunately, the panelMenuGroup collapses always after a request; it doesn't care the selected item.

      My questions are:
      Do i need to track the expanded state of the group also?
      If so, how can i do that in an easy way?
      How works it on the Live Demo site?

      We're currently using RF 3.2.2.GA, but the problem still occurs with 3.0-releases.

      Thanks for any help,