You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jacqueline Gomes <jg...@docep.wa.gov.au> on 2004/02/19 08:47:17 UTC
multiple parameters within iterate loop
Hi All,
I have a question regarding sending multiple parameters through a <html:link> tag.
I understand that you can set it up like this:
<%
java.util.HashMap paramValuesExtract = new java.util.HashMap();
paramValuesExtract.put("nextAction",BNOnlineConstants.NEXT_ACTION_EXTRACT_PDF);
request.setAttribute("paramValuesExtract",paramValuesExtract);
%>
<html:link page="/do/extract/retrieveExtractSearch"
target="_blank"
name="paramValuesExtract">Click to retrieve extract</html:link>
However, I have dynamic values within a bean that I want to send through to the link.
I have a collection retrieveExtractDetails from which I am reading attributes. I want to attach extractId and organisationId to the link as name/value pairs.
<logic:iterate id="retrieveExtractDetails" name="extracts">
<html:link page="/do/extract/retrieveExtractSearch"
target="_blank"
name="paramValuesExtract">Click to retrieve extract</html:link>
</logic:iterate>
Any advice would be apprciated.
Thanks,
Jackie.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: multiple parameters within iterate loop
Posted by Kris Schneider <kr...@dotech.com>.
I'm not completely clear on how you've got your data set up, but something like
this should work with JSTL:
<jsp:useBean id="paramValuesExtract" class="java.util.HashMap"/>
<c:forEach var="retrieveExtractDetails" items="${extracts}">
<c:set target="${paramValuesExtract}"
property="extractId"
value="${retrieveExtractDetails.extractId}"
<c:set target="${paramValuesExtract}"
property="organisationId"
value="${retrieveExtractDetails.organisationId}"
<html:link action="/extract/retrieveExtractSearch"
target="_blank"
name="paramValuesExtract">Click to retrieve extract</html:link>
</c:forEach>
Quoting Jacqueline Gomes <jg...@docep.wa.gov.au>:
> Hi All,
>
> I have a question regarding sending multiple parameters through a <html:link>
> tag.
>
> I understand that you can set it up like this:
>
> <%
> java.util.HashMap paramValuesExtract = new java.util.HashMap();
>
>
> paramValuesExtract.put("nextAction",BNOnlineConstants.NEXT_ACTION_EXTRACT_PDF);
> request.setAttribute("paramValuesExtract",paramValuesExtract);
> %>
>
> <html:link page="/do/extract/retrieveExtractSearch"
> target="_blank"
> name="paramValuesExtract">Click to retrieve extract</html:link>
>
> However, I have dynamic values within a bean that I want to send through to
> the link.
> I have a collection retrieveExtractDetails from which I am reading
> attributes. I want to attach extractId and organisationId to the link as
> name/value pairs.
>
> <logic:iterate id="retrieveExtractDetails" name="extracts">
>
> <html:link page="/do/extract/retrieveExtractSearch"
> target="_blank"
> name="paramValuesExtract">Click to retrieve extract</html:link>
>
>
> </logic:iterate>
>
> Any advice would be apprciated.
>
> Thanks,
>
> Jackie.
--
Kris Schneider <ma...@dotech.com>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org