1 Reply Latest reply on Oct 23, 2010 3:09 AM by hantsy

    Encountered NullPointerException which useing a customsized DataTableDataModel and Rich:extendedDataTable Data

    hantsy

      The action code is like the following...
      @Name("myAction")
      @Scope(ScopeType.CONVERSATION)
      public class MyAction {

      private ExtendedTableDataModel<Addressee> addresseeDataModel;
      //getters and setters
           @In("entityManager")
           private EntityManager em;

      @SuppressWarnings("serial")
      public void createAddresseeDataModel() {
        this.addresseeDataModel = new ExtendedTableDataModel<Addressee>(new DataProvider<Addresee>(){

      //in the implemetation method... I use em for pagination implmetation...but it caused the NPE....


      });
      }
      }



      I call createAddresseeDataModel in @Begin method and getAddresseeDataModel, but got  a NUllPointerException in DataProvider implemetation...It seems it can not found the injected EntityManager in the action class....


      Any help is welcome....