1 Reply Latest reply on May 8, 2007 12:02 PM by Andy Gibson

    @DataTable, <h:dataTable

    Stateless Bean Novice

      Hi,
      I have class with collection like:
      @DataModel
      List myCollection

      @DataModelSelection
      MyEntity selectedEntity;

      and in view
      <h:dataTable ....

      this works for entity, but can I do i with some selected columns from native query, like:

      List myList = em.createNativeQuery("SELECT object.A, object.B");

      and add this list to @DataModel?
      @DataModel
      List myList

      So what should be as datamodelSelection?
      @DataModelSelection
      Object selectedObject?

      this wil work?
      How can i create list with some objects and select current object from list?
      MyEntity selectedEntity;

        • 1. Re: @DataTable, <h:dataTable
          Andy Gibson Novice

          I believe that the @DataModel annotation should work with any kind of object, entities or not regardless of where the list came from. In theory anyways!

          The datamodelselection member should probably be of the lowest type on the object hierarchy. If you have completely unrelated object types, then yes, Object is probably the best type.