1 Reply Latest reply on Feb 21, 2012 3:11 AM by omid pourhadi

    Why dataTable can not show any data

    utrla time Newbie

      @Stateless

      @Name("sayhello")

      public class SayHelloActionImp implements SayHelloInterface {

        private int columnId;

        @In(required=false)

        @Out

        private Person person;

       

        @Out(required=false)

        private List<Person> users;

       

        @PersistenceContext

        private EntityManager em;

       

        /* (non-Javadoc)

        * @see com.session.SayHelloInterface#sayHello()

        */

        public void sayHello()

        {

        em.persist(person);

        person = new Person();

        System.out.println("Save done!");

        users = em.createQuery("select p from Person p").getResultList();

         }

      }

       

      When I configured page.xml to let it re-direct to another xhtml page,

       

      code in that page is like:

       

      <h:dataTable value="#{users}" var="user">

          <h:column>

          <h:outputText value="#{user.name}" />

          </h:column>

      </h:dataTable>

       

      None Result showed on screen, Why? (BTW, persist action has sucessfully finished)