[jboss-user] [JBoss Seam] - Re: Session context variable missing

petemuir do-not-reply at jboss.com
Mon Jun 11 18:42:36 EDT 2007


Argh, fecking forum. Sorry.

anonymous wrote : 
  |   | ...
  |   |     @DataModel
  |   |     private List<Category> categories;
  |   | 
  |   |     @DataModelSelection
  |   |     private Category selectedCategory;
  |   | 
  |   | ...
  |   | 
  |   |     @Create
  |   |     public String init()
  |   |     {
  |   |         if (currentCategory == null)
  |   |         {
  |   | 	currentCategory = (Category) em.createNamedQuery("Category.findRoot").getSingleResult();
  |   |         }
  |   |         return "success";
  |   |     }
  |   | 
  |   | ...
  |   | 
  |   |     public void select()
  |   |     {
  |   |         currentCategory = selectedCategory;
  |   |         return;
  |   |     }
  |   | 
  |   | ...
  |   | 

Assuming you have @Out(scope=SESSION) CurrentCategory currentCategory and you call #{categoryManager.select} method when you change the category that would be a good approach, yes.

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

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



More information about the jboss-user mailing list