6 Replies Latest reply on Oct 22, 2008 12:03 PM by Mark LoSacco

    Is it possible to navigate from a PanelMenuGroup??? :)

    Jan-Martijn Wijnholds Newbie

      Hi everyone,

      I'm building my PanelMenu with a backingBean and i've run into a problem. My menu contains PanelMenuGroups and PanelMenuItems. It's no problem to access a navigation rule with a PanelMenuItem but I can't seem te get it work when i hit a PanelMenuGroup.

      this is the code i'm talking about:

      public HtmlPanelMenu getPanelMenu() {
       if (panelMenu == null) {
      
       panelMenu = new HtmlPanelMenu();
       panelMenu.setId("panelMenu");
       panelMenu.setStyle("width:100%");
       panelMenu.setMode("ajax");
       panelMenu.setIconExpandedGroup("disc");
       panelMenu.setIconCollapsedGroup("disc");
       panelMenu.setIconExpandedTopGroup("chevronUp");
       panelMenu.setIconGroupTopPosition("left");
       panelMenu.setIconCollapsedTopGroup("chevronDown");
       panelMenu.setIconGroupTopPosition("left");
      
       FacesContext facesContext = FacesContext.getCurrentInstance();
       Application appl = facesContext.getApplication();
      
       Iterator iter = kennisgebiedService.getKennisgebieden(0, 0)
       .iterator();
      
       while (iter.hasNext()) {
       Kennisgebied kennisgebied = (Kennisgebied) iter.next();
      
       HtmlPanelMenuGroup menuItemKennisgebied = new HtmlPanelMenuGroup();
       menuItemKennisgebied.setLabel(kennisgebied.getTitel());
       menuItemKennisgebied.setName(kennisgebied.getTitel());
       menuItemKennisgebied.setIconCollapsed("triangle");
       menuItemKennisgebied.setIconExpanded("triangleDown");
      
      //Does not work menuItemKennisgebied.setAction(appl.createMethodBinding("#{userMenuController.go}", new Class [0] ));
      
      
       Iterator iterKennisDomeinen = kennisgebied
       .getCollectieKennisDomein().iterator();
       while (iterKennisDomeinen.hasNext()) {
       Kennisdomein kennisdomein = (Kennisdomein) iterKennisDomeinen.next();
       HtmlPanelMenuItem menuItem_Kennisdomein = new HtmlPanelMenuItem();
       menuItem_Kennisdomein.setLabel(kennisdomein.getTitel());
       menuItem_Kennisdomein.setName(kennisdomein.getTitel());
      
      // Does work menuItem_Kennisdomein.setAction(appl.createMethodBinding("#{userMenuController.go}", new Class [0]));
      
       menuItemKennisgebied.getChildren().add(menuItem_Kennisdomein);
       }
      
       panelMenu.getChildren().add(menuItemKennisgebied);
       }
       }
      
       return panelMenu;
       }


      I hope someone can point me in right direction.

      Regards,

      Jan-Martijn