4 Replies Latest reply on Sep 28, 2011 9:06 PM by hantsy bai

    RichFaces4 autocomplete does not work..

    hantsy bai Master

      I tried to migrate another seam2 page to seam3.
      There is a autocomplete in the page...

      <p:input id="toAddress" label="#{messages['Message.To']}"
                               <rich:autocomplete value="#{composeAction.toAddress}"
                                    <h:outputText value="#{recipient}" style="font-style:bold" />                         

      The composeAction is conversation scoped.

      public class ComposeAction {
           EntityManager em;
           private List<MessageRecipient> autocomplete(String keyword) {
                log.debug("searche by keyword #"+ keyword);
                String sql = "select new com.telopsys.siorc.model.MessageRecipient(e.vessel.name, e.email) from VesselEmail e where e.vessel.stat='A' and (e.vessel.name like :keyword or e.email like :keyword)";
                log.debug("sql statement@ #"+ sql);
                log.debug("em@ #"+ em);
                Query query = em.createQuery(sql);
                return results;

      The problem is the em is null at runtime...

      I got a NullPointerException at the line

      Query query = em.createQuery(sql);