[jboss-user] [JBoss Seam] - Can't load the data from the view

Seto do-not-reply at jboss.com
Sat Oct 28 22:02:49 EDT 2006


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



More information about the jboss-user mailing list