title: Display the dialogue box after checking condition
body: <p>I am checking whether a mail is valid by using regular expressions, on  the dialogue box. And according to the result I want  the dialogue box to close or stay open, but it always closes no matter the mail address is valid or not. My bean function returns correct result(myBean.isValid), I debugged it. What can be the problem? </p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;p:commandButton value="Save"
     actionListener="#{myBean.saveStg}"
     update="growl,stg_panel,stg" 
     oncomplete="if(myBean.isValid){confirmation.hide()}else{confirmation.show()}" /&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>