title: Jsf inputText onkeyup event handler
body: <p>In PrimeFace's <code>inputText</code>, I need to call function ‍‍‍<code>f1()</code> when any key is pressed.</p>
  
  <p>To implement this, in <code>xhtml</code> file I have:</p>
  
  <pre><code>&lt;p:inputText id="userName" onkeyup="#{myBean.f1()}" &gt;
  </code></pre>
  
  <p>And in my <code>MyBean.java</code> i have declared this function:</p>
  
  <pre><code>public void f1()
  {
  // somecode
  }
  </code></pre>
  
  <p>‌But this code throws an exception:</p>
  
  <blockquote>
    <p>javax.faces.FacesException: javax.el.ELException: /index.xhtml
    @103,191 onkeyup="#{MyBean.f1()}": java.lang.NullPointerException</p>
  </blockquote>