4 Replies Latest reply on May 16, 2008 3:09 AM by Dmitry Korotkov

    a4j:actionparam inside dynamically genrated menu

    Dmitry Korotkov Newbie

      I want to make dynamically generated context menu allowing user to change a property of an object represented by rich:dataTable row. Here is my xhtml source code:

      <rich:contextMenu attached="true" submitMode="ajax" id="computers_context_menu">
       <rich:menuItem value="Open" reRender="comptogpanel,computerInfoPanel">
       <a4j:actionparam value="#{bean.selectedComputer2}" assignTo="#{bean.selectedComputer}"/>
       <rich:menuGroup value="Place to">
       <c:forEach items="#{bean.softmanager.depts}" var="item">
       <rich:menuItem value="#{item.name}" reRender="computersDataTable">
       <a4j:actionparam value="#{item}" assignTo="#{bean.selectedComputer2Dept}"/>
       <rich:menuItem value="#{item.name} 2" action="#{bean.selectedComputer2Dept2}"/>
      <rich:dataTable ......>
      <a4j:support event="onRowMouseUp" actionListener="#{bean.computersRowSelected2}"/>
      <rich:componentControl event="oncontextmenu" for="computers_context_menu" operation="show"/>

      Context Menu structure generated OK. But not all menuitems work. "Open" menuitem works fine. Menuitem with caption "#{item.name} 2" works perfectly too (bean method selectedComputer2Dept2 is called). But item with caption "#{item.name}" does not work: setSelectedComputer2Dept method is not called. And there is no exceptions or other output. Context menu dissappeards and nothing more happens.

      What't wrong?