struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raphaël di Cicco <raphael.dici...@atosorigin.com>
Subject Re: forwarding request from select tag
Date Thu, 08 Jan 2004 15:06:52 GMT
my bad the function should return selectBox.options[i].value;
----- Original Message ----- 
From: "Raphaël di Cicco" <raphael.dicicco@atosorigin.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, January 08, 2004 4:04 PM
Subject: Re: forwarding request from select tag


> No you can't, you need to use javascript :
>
> <html:select property="statusfilter"
> onChange="javascript:doSomething(this);">
>           <option value = "All">All</option>
>           <option value = "Completed">Completed</option>
>           <option value = "In process">In process</option>
>   </html:select>
>
>
> doSomething will probably do something like this :
>
> <script language="javascript">
> function doSomething(selectBox)
> {
>  window.location.href = "MyAction.do?id=" + getSelectedValue(selectBox));
> }
> function getSelectedText(selectBox){
>
> for(var i = 0; i < selectBox.length; i++)
>
> if(selectBox.options[i].selected)
>
> return selectBox.options[i].text;
>
> return "";
>
> }
>
> </script>
>
>
> ----- Original Message ----- 
> From: "Namasivayam, Sudhakar (Cognizant)" <NSudhakar@chn.cognizant.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Thursday, January 08, 2004 3:51 PM
> Subject: RE: forwarding request from select tag
>
>
> thanks robert...
> but what i wanted is  to reload the page automatically....
> like
>
> select_Onchange()
> {
> reload the page with the new filter... ==> should i load the jsp file ???
> }
>
> Instead of this java script...  can i do with struts itself????
>
> hope i m clear.
>
>
> thanks,
> sudhakar
>
>
>
>
> -----Original Message-----
> From: Robert Taylor [mailto:rtaylor@mulework.com]
> Sent: Thursday, January 08, 2004 8:14 PM
> To: Struts Users Mailing List
> Subject: RE: forwarding request from select tag
>
>
> If you use <html:option .../> then the selected value should show as being
> selected when
> the page is reloaded.
>
> robert
>   -----Original Message-----
>   From: Namasivayam, Sudhakar (Cognizant)
> [mailto:NSudhakar@chn.cognizant.com]
>   Sent: Thursday, January 08, 2004 9:15 AM
>   To: Struts Users Mailing List
>   Subject: forwarding request from select tag
>
>
>
>
>   Hi all,
>
>   I have a list page which has a combobox to select the filter.
>
>   <html:select property="statusfilter">
>           <option value = "All">All</option>
>           <option value = "Completed">Completed</option>
>           <option value = "In process">In process</option>
>   </html:select>
>
>   The page loads with the value "all" as default.
>
>
>   Now if the different option say "completed" is selected, i want to
reload
> the same page with the new filter status.
>
>   How should i do it?
>
>
>
>   Thanks,
>
>   sudhakar
>
>
>
>
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message