title: How to use multiple forms in one page with JSF 2.0?
body: <p>I try to use multiple forms with JSF 2.0 in one page. I use PrimeFaces 3.0M1 and trying to build an application with tabs and one form per tab.</p>
  
  <p>I've got a page like the following:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
  
  xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"                 
  xmlns:ui="http://java.sun.com/jsf/facelets" 
  xmlns:fn="http://java.sun.com/jsp/jstl/functions" 
  xmlns:p="http://primefaces.prime.com.tr/ui"&gt;
  
  &lt;div&gt;
  &lt;p:tabView&gt;
  &lt;p:tab title="Form1"&gt;
  &lt;h:form id="form1"&gt;
      &lt;p:inputText id="txtInput" value="#{bean1.inputText}" /&gt;
      &lt;p:commandButton title="Submit" value="Submit" actionListener="#{controller1.submitValues}"&gt;
  &lt;/h:form&gt;
  &lt;/p:tab&gt;
  &lt;p:tab title="Form2"&gt;
  &lt;h:form id="form2"&gt;
      &lt;p:inputText id="txtInput2" value="#{bean2.inputText}" /&gt;
      &lt;p:commandButton title="Submit" value="Submit" actionListener="#{controller2.submitValues}"&gt;
  &lt;/h:form&gt;
  &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  &lt;/div&gt;  
  &lt;/html&gt;
  </code></pre>
  
  <p>If I click on the submit button in tab 1, everything works like excpected.
  But, if I click on the button at the second tab, the command will not be executed in controller2. </p>
  
  <p>What is the problem here? If I bind the execution command of button2 to button1 the command in controller2 is executed correctly, so I can exclude that there is a problem in the backing beans.</p>
  
  <p>How can I solve this?</p>