You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Naresh Sharma <Na...@KeaneIndia.Com> on 2004/07/07 06:04:54 UTC

Select + optionsCollection tag

Hi,

 

I have a combo box, and populating hash map values in this box.

 

Once initial form is populated, if user selects any option from this box, it
will submit the form to my action class using method "callOnChange". And
action class does re-populate the value object from backend and forward
control back to this screen. Now the problem is that its not displaying the
selected option which user have selected. Instead first element of the
Hashmap comes as selected.

 

 

<html:select property="userStatus" styleClass="clsGenText" size="1"
onchange=" callOnChange ()">

<html:optionsCollection name="ExampleVO" property="userStatusMap"
label="value" value="key"/>

</html:select>

 

Is there any other way by which we can make the desired option from HashMap
selected?

 

Please suggest.

 

 

Regards

Naresh