This content has been marked as final.
Show 2 replies
-
1. Re: action param is null
jmchiaradia Jul 10, 2009 2:37 PM (in response to jmchiaradia)I found another thread that explain this problem:
http://seamframework.org/Community/UsingSeamELToPassParametersToActionMethodsDoesntAlwaysWork
-
2. Re: action param is null
jmchiaradia Jul 10, 2009 6:16 PM (in response to jmchiaradia)In more detail:
The problem was in using s:commandButton.
From JBOSS El reference:
Use inside iterative components - Components like c:forEach and ui:repeat iterate over a List or array, exposing each item in the list to nested components. This works great if you are selecting a row using a h:commandButton or h:commandLink
However if you want to use s:link or s:button you must expose the items as a DataModel, and use a dataTable (or equivalent from a component set like rich:dataTable ). Neither s:link or s:button submit the form (and therefore produce a bookmarkable link) so a magic parameter is needed to recreate the item when the action method is called. This magic parameter can only be added when a data table backed by a DataModel is used.Then, I replace s:commandButton with h:commandButton and it works just find.
<rich:dataGrid columns="1" value="#{fileUploadBean.uploadedFiles}" var="_file" rowKeyVar="fileId"> <rich:panel bodyClass="rich-laguna-panel-no-header"> <h:panelGrid columns="2"> <h:commandButton action="#{fileDownloadBean.downloadFile(_file)}" value="Download" propagation="join"/> <h:panelGrid columns="2"> <h:outputText value="Nombre:" /> <rich:inplaceInput id="nameField" value="#{_file.name}" required="true" immediate="true" > <a:support event="onchange" bypassUpdates="false" reRender="nameField, nameFieldOut"/> </rich:inplaceInput> </h:panelGrid> </h:panelGrid> </rich:panel> </rich:dataGrid>