-
1. Re: DataModelSelection problem
pmuir Oct 2, 2006 11:16 AM (in response to monkeyden)Can you show your jsf?
-
2. Re: DataModelSelection problem
monkeyden Oct 2, 2006 11:22 AM (in response to monkeyden)Sure, sorry. I highlighted the commandLink of interest.
<h:dataTable id="results" var="user" value="#{usersearch.items}" styleClass="resultsTable" rowClasses="odd,even" first="#{usersearch.firstRowIndex}" rows="#{usersearch.rowsPerPage}" rendered="#{usersearch.rowCount > 0}" headerClass=""> <h:column> <f:facet name="header"> <h:commandLink action="#{usersearch.sortByName}" immediate="true" styleClass="resultsHead"> <h:outputText value="Name" id="nameText"/> </h:commandLink> </f:facet> <h:commandLink value="#{user.name}" action="#{usersearch.select}" immediate="true"/> </h:column> <h:column> <f:facet name="header"> <h:commandLink action="#{usersearch.sortByEmail}" immediate="true" styleClass="resultsHead"> <h:outputText value="Email"/> </h:commandLink> </f:facet> <h:commandLink id="emailLink"> <h:outputText value="#{user.emailAddr}"/> </h:commandLink> </h:column> <h:column> <f:facet name="header"> <h:commandLink action="#{usersearch.sortByDateRegistered}" immediate="true" styleClass="resultsHead"> <h:outputText value="Registered"/> </h:commandLink> </f:facet> <h:outputText value="#{user.dateRegistered}" id="regText"> <f:convertDateTime dateStyle="medium" pattern="MM/dd/yyyy"/> </h:outputText> </h:column> <h:column id="regColumn"> <f:facet name="header"> <h:outputText value="City" id="regText"/> </f:facet> <h:outputText value="#{user.city}" /> </h:column> <h:column id="stateColumn"> <f:facet name="header"> <h:outputText value="State" /> </f:facet> <h:outputText value="#{user.state}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Zip" /> </f:facet> <h:outputText value="#{user.zip}" /> </h:column> </h:dataTable>
-
3. Re: DataModelSelection problem
pmuir Oct 2, 2006 11:36 AM (in response to monkeyden)I don't know if this is the case, but I'm not sure that the DataModelSelection will be updated in immediate=true (and to me it seems unecessary on that page).
-
4. Re: DataModelSelection problem
pmuir Oct 2, 2006 11:37 AM (in response to monkeyden)updated in immediate=true
updated when immediate=true
Sorry -
5. Re: DataModelSelection problem
monkeyden Oct 2, 2006 12:43 PM (in response to monkeyden)Thanks for the reply. I removed the immediate attribute, to no avail. It appeared, however, that because the rows were uniquely named in the resulting JSP, that it should have worked regardless. As you might have gleaned from the JSF, I also implemented a paginator. FWIW, If I were to traverse the paginator, and select a row on a different page, it will also select that page's first row, and not the first row of the entire List.
-
6. Re: DataModelSelection problem
monkeyden Oct 2, 2006 4:44 PM (in response to monkeyden)Is there any requirement of the client to pass a unique identifier back to the SB? Just a thought, though I saw nothing indicating this in the Messages tutorial.
-
7. Re: DataModelSelection problem
pmuir Oct 2, 2006 5:30 PM (in response to monkeyden)I can't see a problem with what you are doing. It's quite simple, it should 'just work' using a JSF datatable and h:commandButton/Link.
I suggest the standard approach: start with a simple table with clickable links (see some of the examples), make sure it is working, and make your additions slowly and check to see where your problem is. -
8. Re: DataModelSelection problem
monkeyden Oct 2, 2006 6:25 PM (in response to monkeyden)I'm very doubtful that it's something on the JSF side. I removed every column with the exception of this one and it still didn't work. It seems pretty clear to me that there is an informational disconnect in the injection. Do all of my annotations appear correct?
@Stateful @Scope(ScopeType.SESSION) @Name("usersearch") public class UserSearchAction implements UserSearch, Serializable { ... @DataModel @Out(required=false) private List<UserView> users; @DataModelSelection @In(required=false) @Out(scope=ScopeType.SESSION, required=false) private UserView user; ... }
Does anyone know of other examples to which I can refer? -
9. Re: DataModelSelection problem
gavin.king Oct 2, 2006 6:32 PM (in response to monkeyden)Don't use @DataModel with @Out.
Don't use @DataModelSelection with @In. -
10. Re: DataModelSelection problem
gavin.king Oct 2, 2006 6:33 PM (in response to monkeyden)ie. Look again at the examples.
-
11. Re: DataModelSelection problem
monkeyden Oct 2, 2006 6:39 PM (in response to monkeyden)BINGO! Thanks Gavin.
Is the @Out incorrect in the tutorial as well?@DataModel private List<Message> messageList; @DataModelSelection @Out(required=false) private Message message;
-
12. Re: DataModelSelection problem
jjarkko Oct 2, 2006 6:42 PM (in response to monkeyden)Is this ok?
@Out(value = "task", scope = ScopeType.SESSION) @DataModelSelection(value = "tasks") Task task;
Btw, also is it "legal" to have @DataModelSelection in another SFSB than from where the @DataModel originated? It didn't work, atleast on my portlet environment where the sender (@DataModel) and the receiver (@DataModelSelection) were actually different on portlets (and also different SFSBs)... So i gave up and ended up passing the selections in the Session scope. -
13. Re: DataModelSelection problem
gavin.king Oct 2, 2006 7:55 PM (in response to monkeyden)You can use @Out with @DataModelSelection. Just like you can use @Out with @In.