title: JSF/Primefaces: CommandButton Redirection
body: <p>Hi I am using CommandButton with ajax="true". I need that the redirection should happen only from oncomplete method. Can anybody please help. Now it is directly redirecting instead of checking any thing in oncomplete.</p>
  
  <pre><code>&lt;p:commandButton id="save"
   global="false" ajax="true"
   value="Submit"
   action="#{OrderBean.saveAndSubmit()}"
   oncomplete="RedirectionJS()"
  /&gt;
  </code></pre>