-
1. Re: trouble passing argument to s:link action
cash1981 Oct 29, 2009 10:32 PM (in response to endelt260)I think you are missing the form element?
-
2. Re: trouble passing argument to s:link action
endelt260 Oct 29, 2009 11:20 PM (in response to endelt260)The dataTable is wrapped in a simple <ice:form> tag. -
3. Re: trouble passing argument to s:link action
endelt260 Oct 30, 2009 1:24 AM (in response to endelt260)At the risk of including too much information, this is a snippet from my pom.xml:
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${seam-version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ui</artifactId>
<version>${seam-version}</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
<version>${icefaces-version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-comps</artifactId>
<version>${icefaces-version}</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-facelets</artifactId>
<version>${icefaces-version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
And my faces-config:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<view-handler>com.icesoft.faces.facelets.D2DSeamFaceletViewHandler</view-handler>
</application>
</faces-config> -
4. Re: trouble passing argument to s:link action
endelt260 Oct 30, 2009 1:55 AM (in response to endelt260)A bit more information... if in the action EL expression, I replace item with a literal string, the string successfully gets passed as an argument to the function.
I'm not sure what that tells us other than, at least on some level, the Seam EL extensions are actually being used as I can pass an argument to the method binding. But, for some reason, it's unable to resolve item. I tried renaming item, in case it was some special reserved word, but still got a null. I got this idea from the booking example...
<ice:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}"> <h:column> <f:facet name="header">Name</f:facet> <ice:outputText id="name" value="#{hot.name}" onmouseovereffect="#{highlight}"/> </h:column> <h:column> <f:facet name="header">Address</f:facet> <ice:outputText id="address" value="#{hot.address}" onmouseovereffect="#{highlight}"/> </h:column> <h:column> <f:facet name="header">City, State</f:facet> <ice:outputText id="city" value="#{hot.city}, #{hot.state}, #{hot.country}" onmouseovereffect="#{highlight}"/> </h:column> <h:column> <f:facet name="header">Zip</f:facet> <ice:outputText id="zip" value="#{hot.zip}" onmouseovereffect="#{highlight}"/> </h:column> <h:column> <f:facet name="header">Action</f:facet> <s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/> </h:column> </ice:dataTable>
So, I'm assuming it is actually possible to pass the var from dataTable as an argument this way... just not sure what I'm missing.
-
5. Re: trouble passing argument to s:link action
swd847 Oct 30, 2009 2:08 AM (in response to endelt260)Use a h:commandLink so the form is submitted and it should work. I think that it is not so much a bug as a limitation of the JSF architecture (you need to restore the view to get the correct value for the parameter, which will not happen on GET requests, not 100% sure about this though).
-
6. Re: trouble passing argument to s:link action
beesa Mar 8, 2010 2:02 PM (in response to endelt260)Hi,
i ran into the same problem.
The generated HTML Code shows that it can't work because it produces a get call wich contains the name of the var instead of any pointer or id.Is this already solved?
I ask me why it seems to work in the hotel example. It is obviously not a String but a complex object in that case.