Hello, I would like to manage access to multiple instances of backing beans .

I would like something like this but working.


  | @Name("perCellForm")
  | public class PerCellFormBean implements PerCellForm {
  | 
  |     HashMap<Long, FormAction> cells = new HashMap<Long, FormAction>(10);
  | 
  |     @In
  |     private Cell currentCell;
  | 
  |     @Unwrap
  |     public FreeAction getCell() {
  | 
  |             if (cells.containsKey(currentCell.getId())) {
  |                     return cells.get(currentCell.getId());
  |             } else {
  | 
  |                     Object component = Component.getInstance("FormAction", 
true);
  | 
  |                     cells.put(currentCell.getId(), (FormAction) component);
  |                     return (FormAction) component;
  |             }
  |     }
  | 
  |     @Destroy
  |     @Remove
  |     public void remove() {
  | 
  |     }
  | }
  | 

Object component = Component.getInstance("FormAction", true);
Obviously doesn't work since the component only will be created once and then 
just re-gotten from the conversation context.

Is it possible to do a manager such as this with seam?

I need to be able to dynamically assign multiple instances of stateful backing 
beans for forms.

I need seam to actually instantiate multiple instances and be able to hold 
references to them, how do I do that?



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

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

Reply via email to