title: <p:commandButton CONDITIONAL onclick event
body: <p>i have a jsf-form with an input field and a save-button as seen in the code below. What i want to achieve is, when the save-button clicked, the input should be validated with the regex-pattern. If the validation failed, no save-confirmation-dialog should be shown. Otherwise a save-confirmation-dialog shown, and let  the user to choose if to save or not.</p>
  
  <p>In the code below, the dialog has always been shown, despite the conditional onclick="if(#{conditionOK}). I want no confirmation-dialog got shown, when conditionOK returns false!!! After many tries, i think the facescontext.isValidateFailed() will not be re-evalutated.</p>
  
  <p>Please help :(</p>
  
  <p>All what i want, is only to check, if the regex-Validator returns true. For this case, the confirmation-dialog should be shown.</p>
  
  <p>My approach could be wrong. Many thank if you guys have also other solutions.</p>
  
  <pre><code>&lt;h:form id="save_all_form"&gt;
        &lt;p:inputTextarea rows="1" style="width:100%;resize:none"
           value="#{cusBean.saveAll}" autoResize="false"
           validatorMessage="Wrong format"&gt;
           &lt;f:validateRegex pattern="#{msgs.pattern}" /&gt;
        &lt;/p:inputTextarea&gt;
  
        &lt;ui:param name="conditionOK" 
           value="#{facesContext.postback and !facesContext.validationFailed}"  /&gt;
  
        &lt;p:commandButton value="#{msgs.button_overwrite_all}"
           onclick="if(#{conditionOK}){confirmation.show()}"/&gt;
  &lt;/h:form&gt;
  </code></pre>