[jboss-user] [JBoss Seam] - Re: Session problems

fernando_jmt do-not-reply at jboss.com
Tue Jun 12 10:34:14 EDT 2007


You can use a page action to refresh your list (when using SESSION scope).

Like this:

  | Stateful
  | @Scope(ScopeType.SESSION)
  | @Name("partsListFinder")
  | public class PartsListFinderBean implements PartsListFinder {
  | 	@In(required=false)
  | 	private String			plName;
  | 	
  | 	@DataModel
  | 	private List<PartsList>		partsLists;
  | 
  | 	@PersistenceContext(type=PersistenceContextType.EXTENDED)
  | 	private EntityManager		em;
  | 
  | 	public void findPartsList() {
  | 		partsLists = em.createQuery("from PartsList pl where pl.name like :name")
  | 			       .setParameter("name", plName + '%')
  | 			       .getResultList();
  | 	}
  | 
  | 	@Factory("partsLists")
  | 	public void findPartsLists() {
  | 		partsLists = em.createQuery("from PartsList").getResultList();
  | 	}
  |          public void reload(){
  |             partsList = null;
  |          }
  | 	@Destroy @Remove
  | 	public void destroy() { }
  | }
  | 
Pages.xml:

  |  <page view-id="/PartsList.xhtml" action="#{partsListFinder.reload}">
  |     </page>
  | 

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053582



More information about the jboss-user mailing list