title: validation problem with JSF h:form and PrimeFaces p:dialog
body: <p>I have a JSF page that is basically a create form.  The form consists of a variety of input fields and also a list of sub-elements.</p>
  
  <p>To add a sub-element, you click the "add element" link which pops up a dialog box using the PrimeFaces p:dialog tag.  It's similar to the login panel demo on the prime faces page here, complete with the p:growl validation messages:</p>
  
  <p><a href="http://www.primefaces.org/showcase/ui/dialogLogin.jsf" rel="nofollow">http://www.primefaces.org/showcase/ui/dialogLogin.jsf</a></p>
  
  <p>My problem is, when I click "add" in the dialog box I see growl validation messages for the fields in the dialog box and also the fields on the main form.  I only want to see the messages for the dialog box.</p>
  
  <p>Is there a way to do this?  I tried embedding a form within a form, but it didn't work.  That is, I tried ...</p>
  
  <pre><code>&lt;h:form&gt;
  
    &lt;p:messages /&gt; &lt;!-- show validation messages for create form contents --&gt;
  
    &lt;h:inputText value .../&gt;
  
    &lt;h:dataTable value .../&gt; &lt;!-- list of sub elements --&gt;
  
    &lt;h:commandLink "shows the add element dialog" ... /&gt;
  
    &lt;p:growl /&gt; &lt;!-- shows the validation messages for dialog contents --&gt;
  
    &lt;p:dialog&gt;
  
       &lt;h:form&gt;
  
         &lt;h:inputText value .../&gt;
  
         &lt;p:commandButton "validate dialog box fields then add the item to the list" .../&gt;
  
       &lt;/h:form&gt;
  
    &lt;/p:dialog&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>... but that didn't work.  Any help is greatly appreciated!</p>