Shove any parameters from your map in to the queryString using jstl

<c:forEach items="${mapOfParams}" var="bleh"><c:set var="blehString" 
value="${blehString}&${bleh}"/></c:forEach>

  var queryString = "?<c:out value="${blehString}" />";

would give you :

  var queryString = "?foo=bar&cheese=yummy";

(thats assuming each value in mapOfParams was a url param in the form "name=value" 
otherwise you would get queryString = "?foo&cheese"; if you see what I mean)

hth
Chris McCormack

-----Original Message-----
From: Chris Roderick [mailto:[EMAIL PROTECTED]
Sent: 01 July 2004 14:14
To: Struts Users Mailing List
Subject: RE: Appending html:option to a html:link


Thank you for your reply.

The only thing that is missing from this are the map of attributes that
I was originally appending to the html:link.  Is it a case of - you can
have one or the other?

Cheers,

Chris

> -----Original Message-----
> From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> Sent: 01 July 2004 15:07
> To: Struts Users Mailing List
> Subject: RE: Appending html:option to a html:link
> 
> Dont think its possilbe unless you use a bit of javascript.
> As its lunchtime I have knocked out a bit of a solution in javascript
(not tested).
> 
> 
> <script language="javascript">
> 
>   var queryString = "?";
>   var count = 0;
> 
> function appendToUrl(newValue){
> 
>       queryString +="&"+count+"="+newValue;
> 
> }
> 
> function doLink(link){
> 
>        location.href=link+queryString;
> }
> 
> </script>
> 
> 
> <html:select name="VectorInfoForm" property="chartFormat"
> onChange="appendToUrl(this.options[selectedIndex].text)" size="1">
> 
>   <html:option value="1">DHTML</html:option>
> 
>   <html:option value="2">Java</html:option>
> 
> </html:select>
> 
> <a href='"javascript:doLink("SingleVectorChartAction.do")'>click
meh</a>
> 
> -----Original Message-----
> From: Chris Roderick [mailto:[EMAIL PROTECTED]
> Sent: 01 July 2004 13:49
> To: [EMAIL PROTECTED]
> Subject: Appending html:option to a html:link
> 
> 
> Hi,
> 
> 
> 
> I have a JSP page that has a list of hml:links, each with a map of
> attributes appended e.g.:
> 
> 
> 
> <html:link href="SingleVectorChartAction.do?" name="attributes">
> 
>   chart
> 
> </html:link>
> 
> 
> 
> (where attributes is a map).
> 
> 
> 
> On the same page, I have a html:select e.g.:
> 
> 
> 
> <html:select name="VectorInfoForm" property="chartFormat" size="1">
> 
>   <html:option value="1">DHTML </html:option>
> 
>   <html:option value="2">Java</html:option>
> 
> </html:select>
> 
> 
> 
> When a user clicks on the link, I would like to append the currently
> selected option from the html:select to the link, without submitting
the
> form.
> 
> 
> 
> Does anybody know if this is possible, and if so - how?
> 
> 
> 
> Thank you in advance,
> 
> 
> 
> Chris
> 
> 
> ***********************************************
> This e-mail and its attachments are confidential
> and are intended for the above named recipient
> only. If this has come to you in error, please
> notify the sender immediately and delete this
> e-mail from your system.
> You must take no action based on this, nor must
> you copy or disclose it or any part of its contents
> to any person or organisation.
> Statements and opinions contained in this email may
> not necessarily represent those of Littlewoods.
> Please note that e-mail communications may be monitored.
> The registered office of Littlewoods Limited and its
> subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
> Registered number of Littlewoods Limited is 262152.
> ************************************************
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


***********************************************
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.
************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to