3 Replies Latest reply on Oct 1, 2007 9:03 AM by Richard Fanning

    rich:PanelMenu

    Richard Fanning Newbie

      Hi,

      I am having difficulty with rich:panelMenu component. I have narrowed it to the simplest case. I have a menu with two items created programatically. When i select a menu item it brings me to the page requested but then the menu items (+ menu groups if i had one ) become unclickable until the page is refreshed??

      My backing bean has session scope using seam(see code)

      I am using RichFaces 3.1.0 + JSF 1.2 + Facelets 1.1.12 + Seam 1.2.1

      The problems exists in both IE & Firefox.

      @Name("menu")
      @Scope(ScopeType.SESSION)
      public class MenuBean {
      
       private String selected = null;
      
       private HtmlPanelMenu pmenu = null;
      
       public MenuBean() {
      
       }
      
       public HtmlPanelMenu getPmenu() {
      
       if (pmenu == null) {
      
       Application app = FacesContext.getCurrentInstance().getApplication();
       pmenu = (HtmlPanelMenu) app.createComponent(HtmlPanelMenu.COMPONENT_TYPE);
      
       pmenu.setMode("ajax");
       pmenu.setExpandSingle(true);
      
       HtmlPanelMenuItem pMenuItem0 = (HtmlPanelMenuItem) app.createComponent(HtmlPanelMenuItem.COMPONENT_TYPE);
       pMenuItem0.setName("Home");
       pMenuItem0.setId("Home");
       pMenuItem0.setLabel("Home");
       MethodExpression methodExpression = app.getExpressionFactory().createMethodExpression(FacesContext.getCurrentInstance().getELContext(), "nav.home", null, new Class<?>[0]);
       pMenuItem0.setActionExpression(methodExpression);
       pmenu.getChildren().add(pMenuItem0);
      
      
       HtmlPanelMenuItem pMenuItem1 = (HtmlPanelMenuItem) app.createComponent(HtmlPanelMenuItem.COMPONENT_TYPE);
       pMenuItem1.setName("Templates");
       pMenuItem1.setId("Templates");
       pMenuItem1.setLabel("Templates");
       methodExpression = app.getExpressionFactory().createMethodExpression(FacesContext.getCurrentInstance().getELContext(), "nav.templates", null, new Class<?>[0]);
       pMenuItem1.setActionExpression(methodExpression);
       pmenu.getChildren().add(pMenuItem1);
      
      
       }
       return pmenu;
      
       }
      
       public void setPmenu(HtmlPanelMenu menu) {
       pmenu = menu;
       }
      
       public String getSelected() {
       return selected;
       }
      
       public void setSelected(String selected) {
       this.selected = selected;
       }
      

      <ui:composition>
      
       <rich:panelMenu binding="#{menu.pmenu}" selectedChild="#{menu.selected}"/>
      
      </ui:composition>
      


      Thanks for the help

      Rich