title: Primefaces and ajax onsuccess event
body: <p>I use ajax <code>remoteCommand</code> component with Primefaces and this component updates <code>inputHidden</code> field with boolean value.</p>
  
  <p>I call JS function on the <code>onsuccess</code> event of <code>remoteCommand</code> but it seems that my function is called before DOM update because when I test <code>inputHidden</code> value, this is not the right value but if I set interval to test 3s after, I have the right value...</p>
  
  <p>Code :</p>
  
  <pre><code>&lt;p:remoteCommand process="..." onsuccess="hideOrShowNotification();" /&gt;
  </code></pre>
  
  <p>First JS test :</p>
  
  <pre><code>function hideOrShowNotification(){
     alert($('#tabView\\:register_form\\:hiddenNotification').val()); 
  }
  </code></pre>
  
  <p>Second JS test :</p>
  
  <pre><code>function hideOrShowNotification(){
    setInterval(function(){alert($('#tabView\\:register_form\\:hiddenNotification').val());}, 3000);  
  }
  </code></pre>
  
  <p>In first case I receive <code>false</code> value and in second case I receive <code>true</code> value. The expected value is <code>true</code>.</p>
  
  <p>So my DOM is not fully loaded when my JS function is called.</p>
  
  <p>How can I call JS function after full loading of DOM ? I believed <code>onsuccess</code> event would do that but no apparently.</p>