-
1. Re: Please help me understand DataModelSelection
holyjoe Aug 18, 2006 9:13 PM (in response to holyjoe)It turns out that the selection isn't even correct on the funky.jsp page. I added an outputText to the page:
<h:outputText value="#{projectEditor.selectedIssue.shortDescription}"/>
<h:commandButton action="#{issueEditor.selectIssue}" value="#{messages.View} #{messages.Issue}"/>
and it always displays the description of the first issue, regardless of which button is pressed.
What am I doing wrong? -
2. Re: Please help me understand DataModelSelection
holyjoe Aug 19, 2006 12:09 PM (in response to holyjoe)For those of you folowing this saga, I have a hypothesis to explain the problem (take it with a grain of salt, though, since I'm a JSF/Seam newbie). In the original issues app, the injection of the data model selection is being done from within an Action event, during a phase in which the view containing the datamodel is active, and so the selection exists. In the modified app, any injection that happens is being done in the render phase of the new view, and the data model (and its selection) is long gone. The value returned by getSelectedIssue is whatever was last injected.
So the moral of my story (if I'm not completely wrong in the above analysis) is that if I want the data model selection from a view, I must call an action that either a) is in the component containing the @DataModelSelection annotation, or b) makes a call to a method in that component.
It seems clear that it must be that way, now that I know the answer. Sigh. Eventually I'll understand this enough to stop hurting myself.