title: Multiple submits from page included dynamically using primefaces ajax
body: <p>I've been struggling with this for a while, I hope someone can help me.  </p>
  
  <p>I have this code working using JSF-2 (taken from a solution given by BalusC in <a href="https://stackoverflow.com/a/7113961/1079323">this question</a>):</p>
  
  <pre><code>&lt;h:panelGroup id="content" layout="block"&gt;
      &lt;h:form id="contentform"&gt;
          &lt;h:panelGroup rendered="#{bean.page == 'include1'}"&gt;
              &lt;ui:include src="include1.xhtml" /&gt;
          &lt;/h:panelGroup&gt;
          &lt;h:panelGroup rendered="#{bean.page == 'include2'}"&gt;
              &lt;ui:include src="include2.xhtml" /&gt;
          &lt;/h:panelGroup&gt;
          &lt;h:panelGroup rendered="#{bean.page == 'include3'}"&gt;
              &lt;ui:include src="include3.xhtml" /&gt;
          &lt;/h:panelGroup&gt;
      &lt;/h:form&gt;
  &lt;/h:panelGroup&gt;  
  </code></pre>
  
  <p>Then, inside each page included, I have something like this (also working):  </p>
  
  <pre><code>&lt;h:outputText value="Name: "/&gt;
  &lt;h:inputText value="#{itemsBean.item.name}" id="name" required="#{not empty param[save.clientId]}"/&gt;                    
  
  &lt;h:outputText value="Desc: "/&gt;
  &lt;h:inputText value="#{itemsBean.item.description}" id="desc" required="#{not empty param[save.clientId]}"/&gt;
  
  &lt;h:commandButton binding="#{save}" label="Save" actionListener="#{itemsBean.save}"&gt;
      &lt;f:ajax render=":contentForm" execute="name desc"
  &lt;/h:commandButton&gt;
  
  &lt;h:dataTable value="#{itemsBean.itemsList}" var="item"&gt;
      &lt;h:column&gt;
          &lt;h:outputText value="#{item.name}" /&gt;
      &lt;/h:column&gt;
      &lt;h:column&gt;
          &lt;h:outputText value="#{item.description}" /&gt;
      &lt;/h:column&gt;
  &lt;/h:dataTable&gt;  
  </code></pre>
  
  <p><strong>Now the problem</strong>.<br>
  It starts when I try to use PrimeFaces for inluded pages, specifically when I replace the <code>&lt;h:commandButton...</code> with:  </p>
  
  <pre><code>&lt;p:commandButton binding="#{save}" value="Save" actionListener="#{itemsBean.save}"&gt;
      &lt;p:ajax update=":contentForm" process="name desc" /&gt;
  &lt;/p:commandButton&gt;  
  </code></pre>
  
  <p>The result is that the form is submited multiple times and even the input fields from the other included (not rendered) pages are processed (total mess).  </p>
  
  <p>I'm using:<br>
  JSF 2.1.1 Mojarra implementation.<br>
  PrimeFaces 3.0-RC2.<br>
  Tomcat 7.<br>
  (Tomcat and JSF are the ones that come with NetBeans 7.0.1)  </p>
  
  <p>Thank you in advance.</p>