title: How to correctly access the data field in an a4j:jsFunction result
body: <p>I am currently trying to validate some front-end values with some server-side methods (as a group) and am running into issues dealing with the result.</p>
  
  <p>Here is the XHTML for the button that starts it all:</p>
  
  <pre><code>&lt;h:commandButton action="#{Bean.save()}" 
          value="Save" 
             id="save" 
        onclick="checkForConfirmation();" /&gt;
  </code></pre>
  
  <p>And the javascript, part of which the button calls, the other part of which the jsFunction calls</p>
  
  <pre><code>function checkForConfirmation()
  {
           var name = document.getElementById("path:to:name").value;
           var address = document.getElementById("path:to:address").value;
           var city = document.getElementById("path:to:city").value;
           var state = document.getElementById("path:to:state").value;
           var zip = document.getElementById("path:to:zip").value;
  
           jsFunc1(name, address, city, state, zip);
  }
  function showConfirmPrompt()
  {
              if(confirm('Confirmation before save')) 
              {
                  return true;
              }
  
              return false; 
  }
  </code></pre>
  
  <p>And finally, the jsFunction which is the problematic piece:</p>
  
  <pre><code>&lt;a4j:form&gt;
          &lt;a4j:jsFunction name="jsFunc1" action="#{Bean.shouldBeConfirmed()}" data="#{Bean.booleanResult}" oncomplete="alert(data); if (data) {showConfirmPrompt();}"&gt;
              &lt;a4j:actionparam name="param1" assignTo="#{Bean.nameToBeValidated}"/&gt;
              &lt;a4j:actionparam name="param2" assignTo="#{Bean.addressToBeValidated}"/&gt;
              &lt;a4j:actionparam name="param3" assignTo="#{Bean.cityToBeValidated}"/&gt;
              &lt;a4j:actionparam name="param4" assignTo="#{Bean.stateToBeValidated}"/&gt;
              &lt;a4j:actionparam name="param5" assignTo="#{Bean.zipToBeValidated}"/&gt;
          &lt;/a4j:jsFunction&gt;
      &lt;/a4j:form&gt;
  </code></pre>
  
  <p>The problem is that, towards the end of this chain of events, the alert(data) in the 'oncomplete' attribute shows that the data is undefined. I need this to be defined in order to know whether or not to show a warning dialogue.</p>
  
  <p>I can confirm that the Bean.shouldBeConfirmed() method is indeed running, and with the right parameters, and indeed returning the correct value, and even setting the value of the Bean.booleanResult variable (which is a normal java boolean). What am I doing wrong here?</p>