3 Replies Latest reply on Sep 30, 2007 2:02 PM by Guy Veraghtert

    How can i dynamically pass action expression?

    Peter Bugiel Newbie

      Hi,

      i apply a <rich:dropDownMenu> which i include into several pages with the <ui:include> tag. The drop down menu has menu items triggering actions (e.g. saving form data, deleting table data). Now i would like to dynamically pass the action method expression like #{someComponent.save} or #{anotherComponent.save} to the action attribute of <rich:menuItem> because this is the only value that changes depending on the page including the drop down menu.
      In other words, i would like to have something like this:

      <ui:include src="/cms/dropdownmenu.xhtml">
       <ui:param name="saveAction" value="#{productManager.save}" /> <ui:param name="deleteAction" value="#{productManager.delete}" />
      </ui:include>

      <rich:dropDownMenu value="Form">
       <rich:menuItem value="Save" action="#{saveAction}"/>
       <rich:menuItem value="Delete" action="#{deleteAction}"/>
      </rich:dropDownMenu>


      Regards,
      Pete