title: Sending a callback to JSF a4j:jsFunction oncomplete event
body: <p>I am trying to make call to JSF functions in my app more dynamic. Instead of static way of writing callback functions to <code>oncomplete</code> event by hand, I wish to <strong>send a callback function as a parameter and make it's invoke inside <code>oncomplete</code> event of the function</strong>. Here's an example:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    myFunc('myParamValue', function(){
      doThis();
      andDoThis();
    });
  &lt;/script&gt;
  
  &lt;a4j:jsFunction name="myFunc" actionListener="#{...}" data="" oncomplete=""&gt;
    &lt;f:param name="myParam" /&gt;
    &lt;f:param name="callback" /&gt;
  &lt;/a4j:jsFunction&gt;
  </code></pre>
  
  <p>I wish to ask if that would be possible by using <code>data</code> attribute of <code>a4j:jsFunction</code>? Something like this:</p>
  
  <pre><code>...
  data="#{myBean.callback}"
  oncomplete="if (typeof window[event.data] == 'function') window[event.data]();"
  ...
  </code></pre>