title: Get the returned value from managed bean in javascript
body: <p>In my application I call a Javascript event which calls a <code>p:remoteCommand</code> named <code>checkPageLayoutsAreSelected</code> as following :</p>
  
  <pre><code>$('selector').on('click', function (e) {
    checkPageLayoutsAreSelected();
  });
  </code></pre>
  
  <p>This is the <code>p:remoteCommand</code> :</p>
  
  <pre><code>&lt;p:remoteCommand name="checkPageLayoutsAreSelected" actionListener="#{beanFormDashboard.checkPageLayoutsAreSelected}" /&gt;
  </code></pre>
  
  <p>This <code>p:remoteCommand</code> will call a method in the <code>beanFormDashboard</code> managed bean which will return a Boolean value :</p>
  
  <pre><code>public Boolean checkPageLayoutsAreSelected(){
      for(DashboardPage dp : dashboardPageList){
          if(dp.getModel() == 0){
              return false;
          }
      }
      return true;
  }
  </code></pre>
  
  <p>So I want to get the returned value by the <code>checkPageLayoutsAreSelected()</code> from the managed bean in the Javascript code. </p>
  
  <p>Something like this :</p>
  
  <pre><code>$('selector').on('click', function (e) {
    var returnedValue = checkPageLayoutsAreSelected();
  });
  </code></pre>
  
  <p>How can I do that?</p>