title: How do I detect a render event in a form using JSF?
body: <p>consider the following form in a JSF page:</p>
  
  <pre><code>&lt;h:form id="countForm"&gt;
    &lt;h:outputText value="#{myBean.count}" /&gt;
    &lt;h:commandButton value="Increment the count!"&gt;
      &lt;f:ajax listener="#{myBean.increment()}" render="@form" /&gt;
    &lt;/h:commandButton&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>This simple code will increment the counter whenever the user clicks the button, via ajax requests.</p>
  
  <p>Suppose I'd also like to show the user an alert informing the new value of the counter whenever the form is updated (rerendered). How would I do that? Is there anything like the code below?</p>
  
  <pre><code>&lt;h:form onUpdate="alert('the new value is #{myBean.count()}')"&gt;
  </code></pre>
  
  <p>I know I could use the "oncomplete" method of primefaces, but the event would be linked to the button instead of the form, that's not what I want.</p>
  
  <p>A counter is not what I'm trying to do, this is just a simple example to better show my problem.</p>
  
  <p>Thank you in advance for any help.</p>