0

While trying to get multiple commandButtons working in on form, I am facing the problem that they add the params to the parameter list instead of just sending one param.

The code looks like this:

<h:form>
 <ui:repeat ...>
  <p:commandButton value="Manage data" action="metadatainput" 
    ajax="false" 
    onclick="this.form.target='_blank'" onsuccess="this.form.target='_self'">
         <f:param name="id"
             value="#{item.id}" />
   </p:commandButton>
  </ui:repeat>
 </h:form>

If I click on two different buttons, the parameter of the second call is still the parameter from the first sending. If I remove the onclick-things (which I found here: Open new window by POST using h:commandButton ), this problem disappears, because every new click needs a "Backward" in Browser and this leads to a new-loading of the parameters. If I look closer at the problem with Firebug, it appears that both parameters are sent - so there are two fields, one containing the old value and one containing the newer. Unfortunately, the older is taken by the page getting the parameter. Googling things like 'commandButton parameter wrong in second click' unfortunately does not lead to helpful things.

Is there any way to get the parameters right for every newly opened window?

Community
  • 1
  • 1
David Georg Reichelt
  • 963
  • 1
  • 15
  • 36

0 Answers0