[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1895) Allow @DataModelSelection annotation to be used without accompanying @DataModel annotation

Wolfgang Schwendt (JIRA) jira-events at lists.jboss.org
Sun Sep 16 22:16:11 EDT 2007

    [ http://jira.jboss.com/jira/browse/JBSEAM-1895?page=comments#action_12377062 ] 
Wolfgang Schwendt commented on JBSEAM-1895:

Yes,  I have the same opinion.  Actually I already wanted to add a comment that this issue could be closed shortly after I opened this JIRA case.     

When I opened this JIRA case, my reasoning was that it would generally be nice to be able use @DataModelSelection and @DataModelSelectionIndex also when there isn't any accompanying @DataModel annotation in the same component,  primarily in order to facilitate unit testing.        

But as already mentioned, we could conduct the injection also with @In, and what's more,    the @In annotation can take as argument also an EL path expression such as @In("#{dataModel.rowData}" rather than just @In("contextVariableName".

I'll close this case therefore.

> Allow @DataModelSelection annotation to be used without accompanying @DataModel annotation
> ------------------------------------------------------------------------------------------
>                 Key: JBSEAM-1895
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1895
>             Project: JBoss Seam
>          Issue Type: Feature Request
>         Environment: CVS based Seam 
>            Reporter: Wolfgang Schwendt
>            Priority: Optional
> At present a @DataModelSelection annotation (and similarly @DataModelSelectionIndex) can ONLY be used in a component when there is also an accompanying @DataModel annotation placed on a field or getter method of the same component.   The method getDataModelSelectionName() of org.jboss.seam.Component enforces this requirement.  However, it would be very useful if the @DataModelSelection annotation could also be used in a component which doesn't expose a DataModel via @DataModel.  It would allow the programmer to handle a data model selection in a different backing bean than the backing bean which exposed the DataModel, or put in other words, separate the data model generation from the selection event handling.
> If there are conceptual reasons against doing this, please document them in the Seam documentation.
> Workaround at present: Rather than using @DataModelSelection, inject the DataModel with "@In" into the component that should process the selection and get access to the selected row and selectionIndex via the injected DataModel.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list