title: Call multiple bean method in primefaces simultaneously
body: <p>I am building a web application using primefaces-4.0. I wanted to call two bean methods simultaneously on click of command button. I tried it by using <strong>remoteCommand</strong>.</p>
  
  <pre><code>&lt;p:commandButton value="Submit" ajax="false"
                          actionListener="#{userBean.execute}"
                          onclick="callCorrelation()"&gt;
                      &lt;/p:commandButton&gt;
                      &lt;p:remoteCommand name="correlation" update="correlationDialog"
                          actionListener="#{userBean.correlation}" /&gt;
  </code></pre>
  
  <p>Java Script function : </p>
  
  <pre><code>&lt;head&gt;
  &lt;script type="text/javascript"&gt;
      $(document).callCorrelation(function() {
          correlation ();
      });           
  &lt;/script&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>But it did not work.</p>
  
  <p>Is there any other way to call two bean methods simultaneously?</p>