title: using "oncomplete" in a commandButton even when onclick is empty?
body: <p>In a jsf 2 project, a commandButton with id "displayDialog" is hidden. It gets triggered by a javascript function:</p>
  
  <pre><code> document.getElementById('displayDialog').click();
  </code></pre>
  
  <p>The thing is, I need the click action to be performed at the stage of "oncomplete", not "onclick" (for a reason explained by @BalusC <a href="https://stackoverflow.com/questions/13100749/confirmdialog-appears-but-disappears-immediately">here</a>).</p>
  
  <p>I tried to do:</p>
  
  <pre><code>    &lt;p:commandButton style="display: none" id="displayDialog" type="button" onclick="" oncomplete="cd.show();"/&gt;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>    &lt;p:commandButton style="display: none" id="displayDialog" type="button" onclick="return false;" oncomplete="cd.show();"/&gt;
  </code></pre>
  
  <p>but in both cases cd.show() is not actioned. How should this be done?</p>
  
  <p>(Should I just add a dummy action in the onclick attribute? If so which one?)</p>