title: p:multiSelectListbox with Ajax
body: <p>How can I use <code>p:multiSelectListbox</code> with ajax event? I would like enabled button when user chose some option.</p>
  
  <pre><code>&lt;p:multiSelectListbox value="#{assignLecturerBacking.lecturerToAssignId}" effect="slide"&gt;  
      &lt;f:selectItems value="#{assignLecturerBacking.lecturerList}"/&gt;  
      &lt;f:ajax event="click" render="bt"/&gt;
  &lt;/p:multiSelectListbox&gt;  
  
  &lt;h:commandButton id="bt" value="#{msg.assignLecturer}" action="#assignLecturerBacking.assignLecturer(true)}"/&gt;
  </code></pre>
  
  <p>I try <code>f:ajax</code> with <code>event=click</code> or <code>event=valueChanged</code> but i get some exception:</p>
  
  <pre><code>java.lang.NullPointerException
  org.apache.myfaces.view.facelets.tag.jsf.core.AjaxHandler.applyAttachedObject(AjaxHandler.java:351)
  org.apache.myfaces.view.facelets.tag.jsf.core.AjaxHandler.apply(AjaxHandler.java:228)
  javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)
  javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)
  org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)
  ....
  </code></pre>
  
  <p>with <code>&lt;p:ajax event="change" update="bt"/&gt;</code> i get <code>java.lang.NullPointerException</code> too:</p>
  
  <pre><code>java.lang.NullPointerException
  org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.applyAttachedObject(AjaxBehaviorHandler.java:178)
  org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.apply(AjaxBehaviorHandler.java:157)
  javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)
  javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)
  org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)
  javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)
  javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)
  javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58)
  org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294)
  javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53)
  javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49)
  ....
  </code></pre>