title: PrimeFaces - Don't close dialog when messages appears
body: <p>How can I set up a Primefaces Dialog to not hide, when there are "required-messages" open? At this moment, the dialog will closing by clicking on the "Speichern" Button, and when reopened, the messages appears... I would like to let the dialog open, when there are unfilled required fields:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:panelGrid id="createNewPat" columns="3" cellpadding="1" style="margin:0 auto;"&gt;  
      &lt;h:outputText for="versNr" value="Versicherten-Nr.:" /&gt;  
      &lt;p:inputMask id="versNr" value="#{patientenBean.versNr}" required="true"/&gt;  
      &lt;p:message for="versNr" /&gt;
      &lt;p:commandButton id="saveBtn" value="Speichern" 
           action="#{patientenBean.createPatient}" 
           oncomplete="if (!args.messageOccured) createNewPat.hide();" 
           update="patForm" /&gt;
      &lt;p:commandButton id="resetBtn" value="Reset" type="reset" /&gt; 
  &lt;/h:panelGrid&gt;
  </code></pre>