title: f:ajax onevent doesn't work with predefined function, but works with inline function
body: <p>I have a <code>&lt;h:commandButton&gt;</code> which submits a form by <code>&lt;f:ajax&gt;</code>.</p>
  
  <pre><code>&lt;h:commandButton  value="Create Project" styleClass="greyishBtn submitForm"&gt;
      &lt;f:ajax execute="@form" listener="#{projectController.create}" 
          render=":tblProject" /&gt;
  &lt;/h:commandButton&gt;
  </code></pre>
  
  <p>It works as it should be, but when I tried to add <code>onevent</code> attribute like:</p>
  
  <pre><code>&lt;f:ajax execute="@form" listener="#{projectController.create}"
      onevent="createProjectEventHandler" render=":tblProject" /&gt;
  </code></pre>
  
  <p>with this JavaScript that is already been included:</p>
  
  <pre><code>function createProjectEventHandler(data){
      console.log('sth happened');
  }
  </code></pre>
  
  <p>and click on button, then it just reloads the page. I don't see anything has been submitted back to managed bean and nothing on console.</p>
  
  <p>How is this caused and how can I solve it?</p>
  
  <hr>
  
  <p><strong>Update</strong>: it works with the following approach:</p>
  
  <pre><code>&lt;f:ajax execute="@form" listener="#{projectController.create}" 
      onevent="function(data) {console.log('aaa');}" render=":tblProject" /&gt;
  </code></pre>
  
  <p>Why is that so? Based on <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gkddf.html" rel="nofollow">the Java EE 6 tutorial on f:ajax events</a>, the <code>onevent</code> attribute should support a JavaScript function name.</p>