title: h:commandButton with oncomplete function and download a file
body: <p>I have a little problem because i need to download a file (and for that i only can with h:commandButton) but i needed the oncomplete function (that only works with a4j:commandButton) to appear a Running Status.
  The sample of the code is this:</p>
  
  <pre><code> &lt;h:commandButton
          id="downloadReportButton"
          action="#{reportingBean.createAndDonwloadFile()}"               
   /&gt;
  </code></pre>
  
  <p>I already try to do  it like in this response by BalusC: <a href="https://stackoverflow.com/a/31267418/1777424">https://stackoverflow.com/a/31267418/1777424</a> but the problem is because of Ajax requests are not perform.</p>
  
  <pre><code>&lt;h:commandButton
          id="downloadReportButton"
          action="#{reportingBean.createAndDonwloadFile()}"/&gt;
          &lt;f:ajax onevent="oneventFunction" /&gt;
   &lt;/h:commandLink&gt;
  
  function oneventFunction(data) {
      if (data.status === "success") {
          oncompleteFunction();
      }
  }
  </code></pre>