title: Jsf calling bean method from input text when pressing enter
body: <p><em>JSF 2.0, Mojarra 2.0.1, PrimeFaces 3.4.1</em></p>
  
  <p>Here is a <code>p:inputText</code> component which is expected to call a backing bean method when the enter key is pressed.</p>
  
  <pre><code>&lt;p:inputText id="commentInput" rendered="#{status.haveComment}" 
      value="#{statusBean.newComment}"
      onkeypress="if (event.keyCode == 13) { onchange(); return false; }"&gt;
      &lt;f:ajax event="change" listener="#{statusBean.test}" /&gt;
  &lt;/p:inputText&gt;
  </code></pre>
  
  <p>While backing bean has the method of:</p>
  
  <pre><code>public void test(AjaxBehaviorEvent event) {
     System.out.println("Pressed enter!");
  }
  </code></pre>
  
  <p>It's calling method when enter key is pressed but it has more than this; <strong>unexpected behaviour case:</strong></p>
  
  <pre><code>--Click input text
  ----Type some letters
  ------Click somewhere else in the page
  --------CONSOLE: Pressed enter!
  </code></pre>
  
  <p>I think <code>ajax event=change</code> detects a change somehow and calls the method. How to convert this <code>p:inputText</code> component into a proper comment taker component like Facebook or others has?</p>