'rapport' needs to be a property on your form bean, not a request parameter/attribute. The 'property' attribute on the <html:select> tag tells Struts that the current selection is stored in that property. If the value of any enclosed <html:option> tag matches the value in that property, the corresponding option will automatically be selected.

L.

Søren Blidorf wrote:
Hi Mike.

That's what I hoped.

There is a request.GetParameter("rapport"), but that does not do
anything to the html:select

Soren

-----Oprindelig meddelelse-----
Fra: Mike Baroukh [mailto:[EMAIL PROTECTED] Sendt: 10. november 2006 17:33
Til: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Emne: Re: <option value="" selected> converted to <html:option value="">

Hi.

I think that you don't have so specify "selected" : struts will automatically add it if the value of the option is equals to the value of the property ...

Mike


Søren Blidorf a écrit :
How can I convert the following to Struts:

<select name="rapport">
<option value="one" selected>one</option>
<option value="two">two</option>
<option value="tree">tree</option>
</select>

This does not work:

<html:select property="rapport">
<html:option value="one" selected>one</option>
<html:option value="two">two</option>
<html:option value="tree">tree</option>
</html:select>

It is very important for me to specify which is "selected"

BR.

Soren, DK


---------------------------------------------------------------------
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