title: Automatically show validation messages in p:dialog on validation failure
body: <p>I want to present validation messages and messages from backing bean in <code>&lt;p:dialog&gt;</code> component. In my JSF page I have following dialog defined:</p>
  
  <pre><code>&lt;p:dialog widgetVar="messageDialog" id="msgDialog" modal="true" appendToBody="true"&gt;
      &lt;h:form id="messageForm"&gt;
          &lt;p:messages id="messagesInDialog" /&gt;
          &lt;p:commandButton value="OK" onclick="messageDialog.hide()" /&gt;
      &lt;/h:form&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>I execute the following code after appending some message in backing bean:</p>
  
  <pre><code>RequestContext.getCurrentInstance().execute("messageDialog.show()");
  </code></pre>
  
  <p>and it works fine.</p>
  
  <p>However, I also want to display bean validation messages in this dialog. Messages are appended to <code>&lt;p:message&gt;</code> component afer validation, but I have no idea how to display this dialog after validation failure.</p>
  
  <p>How can I achieve this?</p>