title: How to execute a4j:commandLink oncomplete only when validation has succeed?
body: <p>I am using JSF2, Richfaces4 and Spring. I have a command link. On execute I save records and on complete I execute search to display records like following code.
  Problem is that <code>fireSearch()</code> in oncomplete executes even if there is a validation error in form. I need to execute <code>fireSearch()</code> only when the record get saved successfully.</p>
  
  <p>How can I the oncomplete only when validation has succeed?</p>
  
  <pre><code>&lt;a4j:commandLink styleClass="button" action="#{myBean.save}" render="detail_form" execute="@form" oncomplete="fireSearch()"&gt;
  &lt;span&gt; Save &lt;/span&gt;
  &lt;/a4j:commandLink&gt;
  </code></pre>