I just coded as the example dvdstore, I'm cofused about loading the data from 
the view. In the view #{rs==null} return true. Does it need some other codes or 
settings to load the data ignored in the example?


  | /**
  |  * 
  |  */
  | package cn.net.kdc.action.cms;
  | 
  | import java.util.*;
  | import javax.ejb.*;
  | import javax.persistence.*;
  | 
  | import org.jboss.seam.*;
  | import org.jboss.seam.annotations.*;
  | import org.jboss.seam.annotations.datamodel.*;
  | 
  | import cn.net.kdc.domain.global.*;
  | 
  | /**
  |  * @author Seto
  |  * 
  |  */
  | @Stateful
  | @Name("haha")
  | @Scope(ScopeType.SESSION)
  | public class Haha implements IHaha {
  |     @PersistenceContext
  |     private EntityManager entityManager;
  |     
  |     @DataModel
  |     List rs;
  | 
  |     public String getTest() {
  |             return entityManager.find(Resource.class, 1).getTag();
  |     }
  | 
  |     public String getMm(){
  |             return ((Resource)rs.get(0)).getTag();
  |     }
  |     
  |     @Factory("rs")
  |     public void gets(){
  |             rs = entityManager.createQuery("from Resource 
resource").getResultList();
  |     }
  | 
  |     @Destroy
  |     @Remove
  |     public void destroy() {
  | 
  |     }
  | }
  | 
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981571#3981571

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981571
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to