rich:dataTable and back button
hubaer Nov 27, 2009 5:11 PMHello all,
I have a little problem with the back button in Seam. We have an overview page, in which you can select an entry to get to a detail page.
Say, we have 2 entries in our overview page. I select the first one, I get redirected tothe detail page. After going back with the browser back button and select the same entry again, all is ok.
If I select another entry, a null value is passed into the method showMember (see below).
Here some code fragments, hoping someone can help me in this issue:
ActionBean defining the DataModel
@Name("SearchAction") @Scope(ScopeType.SESSION) public class SearchActionBean implements Serializable { ... @In(create=true) private FacesMessages facesMessages; @DataModel private List<Invoice> invoices = null; public void find() { // queryInvoices } ...
ActionBean for the detail information
@Name("showActionBean") @Scope(ScopeType.SESSION) public class ShowActionBean implements Serializable { ... @In() @Out(required=false) private Member member; public void showMember(Member member) { this.member = member; } ...
Fagment from the .xhtml
... <rich:dataTable id="invoiceList" columnClasses="col" value="#{invoices}" var="inv" > <rich:column width="55" sortBy="#{inv.documentNumber}"> <f:facet name="header"> <h:outputText styleClass="headerText" value="#{messages['documentNo']}" /> </f:facet> #{inv.documentNumber} </rich:column> <rich:column width="50" sortBy="#{inv.documentDate}"> <f:facet name="header"> <h:outputText styleClass="headerText" value="#{messages['documentDate']}" /> </f:facet> <h:outputText value="#{inv.documentDate}"><f:convertDateTime pattern="#{commonDataHelper.datePattern}" type="date" /></h:outputText> </rich:column> <rich:column width="50" sortBy="#{inv.member.username}"> <f:facet name="header">#{messages['username']}</f:facet> <s:link action="#{showAction.showMember(inv.member)}" styleClass="noDecoration">#{inv.member.username}</s:link> </rich:column> ...
pages.xml
.... <page view-id="/invoice/invoiceSearch.xhtml"> <navigation from-action="#{showAction.showMember(inv.member)}"> <redirect view-id="/protected/memberDetail.xhtml"/> </navigation> </page> ...
I tried the @DataModelSection, and get the selected entry direct from the search action instead of the var from the rich:dataTable.
I don't know if this is a problem with Seam and RichFaces !?!
Our environment:
- Seam 2.2.0.GA
- RichFaces 3.2.2.SR1
- Trinidad 1.2.12
Hoping someone could point me on what I'm missing.
Regards
Marco