4 Replies Latest reply on Nov 20, 2008 10:14 AM by Ilya Shaikovsky

    f:param with rich:panelMenuGroup and rich:panelMenuItem

    Hoang Nguyen Newbie

      hi
      What i want to do is something likes

      <rich:panelMenuGroup label="Group 1">
       <a4j:support event="onclick" action="#{panelMenuState.onClick}" >
       <f:param name="clickedItem" value="Group1"/>
       </a4j:support>
      </rich:panelMenuGroup>
      


      and

      <rich:panelMenuItem label="Item 2.1"
       action="#{panelMenu.updateCurrent}">
       <f:param name="current" value="Item 2.1" />
      </rich:panelMenuItem>
      


      but i want to write this in java code. I have problem that i don't know how i can pass parameter ( <f:param name="clickedItem" value="Group1"/> or <f:param name="current" value="Item 2.1" />)

      what i have done
      HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
      ajaxSupport.setActionExpression(FacesContext.getCurrentInstance()
       .getApplication().getExpressionFactory()
       .createMethodExpression(
      FacesContext.getCurrentInstance().getELContext(),"#{navigationMenu.onClick}", String.class, new Class[] {}));
      ajaxSupport.setEvent("onclick");
      ajaxSupport.setReRender("output");
      menuGroup1.getFacets().put("a4jsupport", ajaxSupport);
      


      can someone help me, i have not found in "richfaces users guide"
      thanks in advance