title: How to execute h:commandButton actionListener before onclick?
body: <p>I need some help in the below code </p>
  
  <pre><code>                &lt;h:commandButton  id="WhatifButtonID" value="#{demandBean.dmdReviewScreenLabelVO.whatIf}" style="width:60px; height:22px;"  actionListener="#{demandBean.whatif}"  onclick="window.open('DemandTargetList.xhtml','whatif','width=460,height=280,top=150,left=350,resizable=no,scrollbars=no')" &gt;
                      &lt;f:ajax execute="@this" &gt;&lt;/f:ajax&gt;
                  &lt;/h:commandButton&gt;
  </code></pre>
  
  <p>In the above case, the onclick attribute gets executed first followed by the actionlistener attribute. I wanted the actionListener attribute to get executed first followed by the onclick function, since the page that loads onclick needs to get certain values from the actionListener.  Please let me know how to acheive the same. Thanks in Advance. </p>