[jboss-user] [JBoss Seam] - Re: two @datamodel in one sessionbean?

jacob.orshalick do-not-reply at jboss.com
Sun Sep 16 12:55:05 EDT 2007


The value provided for your @DataModelSelection should specify the @DataModel it is related to.  Based on your example above,


  | ...
  | @DataModel(value="list1")
  | private List<String> list1;
  | 	
  | @DataModelSelection(value="list1")
  | private String focusList1;
  | ...
  | 

This should be specified for each @DataModel and @DataModelSelection in order to allow Seam to determine which @DataModelSelection is associated with which @DataModel.  Now, if you want to outject the @DataModelSelection, you will have to do so explicitly through:


  | ...
  | @DataModel(value="list1")
  | private List<String> list1;
  | 	
  | @DataModelSelection(value="list1")
  | @Out(required=false, value="focusList1")
  | private String focusList1;
  | ...
  | 

The above will allow you to access #{list1} as your @DataModel and #{focusList1} as your @DataModelSelection.

The getters and setters you specified are not necessary to access these attributes from EL expressions as Seam outjects them directly into the context although you may keep the getters and setters for unit testing (makes sense).  Hope that helps.

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

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



More information about the jboss-user mailing list