title: How do I pass a parameter to Primefaces menuitem that shows a dialog?
body: <p>I have a p:menuButton which contains several p:menuitems. Each of these items has to calls a method with a certain parameter on the session scoped backing bean and open a modal dialog which depends on that backing bean. My p:menuitem looks like this:</p>
  
  <pre><code>&lt;p:menuitem value="..." oncomplete="dialog.show()" update=":dialog" actionListener="#{myController.createNewItem}"&gt;
  &lt;/p:menuitem&gt;
  </code></pre>
  
  <p>The parameter passed to myController.createNewItem is the only thing that depends on which menuitem was clicked and I tried to pass it in 3 ways:</p>
  
  <p>1) <code>&lt;f:setPropertyActionListener target="#{myController.newItem.property}" value="..." /&gt;</code></p>
  
  <p>This doesn't work because modal dialog seems to block f:setPropertyActionListener. The setter for myController.newItem.property gets called only after I close the dialog, which is not good enough. It works if the dialog is not modal, but I really need it to be modal.</p>
  
  <p>2) <code>&lt;f:attribute name="param" value="..." /&gt;</code>
  event.getComponent().getAttributes() returns a map with a single element, which looks something like some_namespace.MARK_ID => some number, which is clearly not the parameter I wanted to pass.</p>
  
  <p>3) <code>&lt;f:param name="param" value="..." /&gt;</code>
  I read this works only with action, not actionListener, but tried it anyway.
  FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap() contains all the fields on my form as well as some extra parameters, but not the one I wanted to pass, so I guess it doesn't work.</p>
  
  <p>Is there any way to do what I'm trying to do here or am I stuck with using f:setPropertyActionListener and non-modal dialog? Thanks.</p>