[jboss-user] [JBoss Seam] - T or F? - <s:link/> in dataTable must use @DataModel or REST
jfrankman
do-not-reply at jboss.com
Tue Oct 23 09:29:49 EDT 2007
Just a simple yes or no question. From my reading about s:link it looks like if you want to use it in a clickable list you must either use it conjunction with the @DataModel annotation in your session bean or you must use a RESTful approach by sending in the id of the component on the list and look it up again on the server side.
I found that if I used s:link in a dataTable it did not inject the object in the DataTable into the session bean. Once I changed the link to an <h:commandLink> the selected object on the data table would be properly injected into my session bean.
This injects the selected object from datatable:
<h:commandLink value="Edit" action="#{officeTransmittalAction.editClientTransmittalLineItem}" />
This does not inject the selected object from the datatable without @DataModel
<s:link value="Edit" action="#{officeTransmittalAction.editClientTransmittalLineItem}" />
<rich:dataTable value="#{clientTransmittal.lineItemsList}"
| var="lineItem"
| rendered="#{not empty clientTransmittal.lineItemsList}"
| rowClasses="rvgRowOne,rvgRowTwo"
| id="countytranslineitemsesTable">
|
| <h:column>
| <f:facet name="header">description</f:facet>
| <h:outputText value="#{lineItem.description}" />
| <rich:spacer />
| </h:column>
| <h:column>
| <f:facet name="header">
| <rich:spacer />
| </f:facet>
| <h:commandLink value="Edit"
| action="#{officeTransmittalAction.editClientTransmittalLineItem}" />
| </h:column>
| </rich:dataTable>
@Stateful
| @Name("officeTransmittalAction")
| @Scope(ScopeType.SESSION)
| public class OfficeTransmittalsActionImpl implements OfficeTransmittalsAction {
|
| @In(required=false,value = "lineItem") @Out(required = false, value = "lineItem")
| private ClientTransmittalLineItemVO clientTransmittalLineItemx;
|
| public String editClientTransmittalLineItem()
| {
| return null;
| }
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097887#4097887
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097887
More information about the jboss-user
mailing list