This content has been marked as final.
Show 1 reply
-
1. Re: Selecting item from list
trixom May 7, 2008 4:00 PM (in response to trixom)Somehow just posting here always seems to help:
This is how I got it working:
basically i use the xxxList.java object generated by seam-gen.
I add the following items:
private Country selectedCountry; ... public Country getSelectedCountry() { return this.selectedCountry; } public void setSelectedCountry(Country selectedCountry) { this.selectedCountry = selectedCountry; }
in the List.xhtml I have the following (parentList is CountryList):
<rich:scrollableDataTable value="#{parentList.resultList}" var="country" height="200px" width="540px" rendered="#{not empty parentList.resultList}"> <a:support event="onRowClick" action="#{parentList.setSelectedCountry(country)}" reRender="countryMenuPanel, countrySubPanel" /> <h:column> <f:facet name="header"> <s:link styleClass="columnHeader" value="#{messages.id} #{parentList.order=='country.id asc' ? messages.down : ( parentList.order=='country.id desc' ? messages.up : '' )}"> <f:param name="countryOrder" value="#{parentList.order=='country.id asc' ? 'country.id desc' : 'country.id asc'}" /> </s:link> </f:facet> <h:outputText value="#{country.id}" /> </h:column> ...
The panels that are rerendered are used to display the subobjects of the selected object and a menu in which I can delete and edit the selected object.
Thanks,
Tom