2 Replies Latest reply on Feb 8, 2008 9:57 AM by Benjamin Outram

    actionListener method is ignored on rich:panelMenuItem

    Benjamin Outram Newbie

      Hello

      When a rich:panelMenuItem item is clicked the actionListener method is not executed if the parent rich:panelMenu 'expandSingle' attribute is set to true.

      For example

      <f:view>
      <h:form>
      <rich:panel id="menuPanel" styleClass="panel_menu">
       <rich:panelMenu id="menu" expandSingle="true">
       <rich:panelMenuGroup label="Group1">
       <rich:panelMenuItem label="Item" actionListener="#{menu.itemClicked}"/>
       </rich:panelMenuGroup>
       <rich:panelMenuGroup label="Group2"/>
       </rich:panelMenu>
      </rich:panel>
      </h:form>
      </f:view>
      
      public class MenuBean
      {
       public void itemClicked(ActionEvent event)
       {
       System.out.println("menu item clicked");
       }
      }
      
      <managed-bean>
       <managed-bean-name>menu</managed-bean-name>
       <managed-bean-class>MenuBean</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
      


      I have also tried binding the rich:panelMenu to a HtmlPanelMenu in MenuBean and setting expandSingle programatically. I get the same result.

      If the value of expandSingle single is set to false then the method is executed normally and the message 'menu item clicked' is printed.

      I have tried richfaces 3.1.3.GA and 3.1.4.GA.
      JSF RI 1.2_04-b20-p03.
      Application server is Glassfish-v2.