title: Primefaces onclick and onsuccess differences
body: <p>I have the following situation:</p>
  
  <p>after clicking a button, some business logic is done and after it is done, a new tab with a report should be visible.</p>
  
  <pre><code>&lt;p:commandButton value="this button" update="growlMain"
                   actionListener="#{myBean.businesslogic}" 
                   onstart="ajaxDialog.show();"
                   oncomplete="ajaxDialog.hide();"
                   onsuccess="window.open('./report.jsp', '_newtab');" /&gt;
  </code></pre>
  
  <p>This does not work :(</p>
  
  <p>If the business logic only lasts some milliseconds, the following works:</p>
  
  <pre><code>&lt;p:commandButton value="this button" update="growlMain"
                   actionListener="#{myBean.fastbusinesslogic}" 
                   onclick="window.open('./report.jsp', '_newtab');" /&gt;
  </code></pre>
  
  <p>the onclick opens a new tab, also things like onstart but it doesn't work with onsuccess or oncomplete. Why? And is there a solution for business logic that lasts some seconds?</p>