[jboss-user] [JBoss Seam] - Destroying Context Variable

terryb do-not-reply at jboss.com
Mon Oct 22 06:07:06 EDT 2007


How can one destroy or reinitialise say seam session context variable. I've got values (extracted from database) in List, for a pulldown menu outjeced to session in @factory method. When I add/update record in db, I would like to refresh the session var.

I manullay invoke the @factory methods after insert/update/delete record, but context var values remain unchanged.

may be @factory method, only outject if invoked by seam?


  | 
  | @Factory(scope=ScopeType.SESSION)
  | public List<SelectItem> getOrganisationListAll() {
  | 
  | 	log.info("Loading organisationListAll...");
  | 
  | 	OrganisationList orgList = (OrganisationList) Component.getInstance(OrganisationList.class, true);
  | 	orgList.setOrder("longName asc");		
  | 	orgList.refresh();
  | 
  | 	List<Organisation> orgs = orgList.getResultList();
  | 
  | 	List<SelectItem> orgSelectItems = new ArrayList<SelectItem>();		
  | 	for (Organisation org : orgs) {
  | 		orgSelectItems.add(new SelectItem(org.getId().toString(), org.getLongName()));
  | 	}
  | 
  | 	log.info("Loaded organisationListAll: " + orgSelectItems.size());
  | 
  | 	return orgSelectItems;
  | }
  | 
  | 
  | //I invoke vollowing, after insert/update/delete of record.
  | //Query in above methods gets records correctly but "organisationListAll" doesn't get refreshed.
  | 
  | public void reloadContextVar() {
  |  ...
  |  getOrganisationListAll();			
  |  ...
  | }
  | 

New records are only laoded if I log off/on.

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

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



More information about the jboss-user mailing list