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)" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to