I want to set the value of my select box, but can't get the value in
there.
The following, works perfect:
<html:select property="selectedShortCodeL" value="400">
<html:optionsCollection name="ctform" property="shortCodeList"
label="name" value="name"/>
</html:select>
But I want to make value dynamic.
<bean:write name="ctform" property="scSet"/> This value is 400, but
how do I put it in the select property?
This doesn't work:
<html:select property="selectedShortCodeL" value="scSet">
<html:optionsCollection name="ctform" property="shortCodeList"
label="name" value="name"/>
</html:select>
------------------
This doesn't work:
<html:select property="selectedShortCodeL" name="ctform"
value="scSet">
------------------
This doesn't work (I set selectedShortCodeL=400) :
<html:select property="selectedShortCodeL" name="ctform"
value="selectedShortCodeL">
------------------
This doesn't work:
<html:select property="selectedShortCodeL" value="<bean:write
name="ctform" property="scSet"/>">
Tim Slattery - 14 Mar 2006 22:16 GMT
>I want to set the value of my select box, but can't get the value in
>there.
[quoted text clipped - 19 lines]
><html:select property="selectedShortCodeL" name="ctform"
>value="scSet">
Use the EL version of the tag:
<html-el:select property="selectedShortCodeL" name="ctform"
value="${ctform.scSet}" />
--
Tim Slattery
Slattery_T@bls.gov
Tim B - 15 Mar 2006 07:48 GMT
> I want to set the value of my select box, but can't get the value in
> there.
[quoted text clipped - 29 lines]
> <html:select property="selectedShortCodeL" value="<bean:write
> name="ctform" property="scSet"/>">
initialize the property "selectedShortCodeL" in your form bean to the
desired value. This can be done in initializer action or in the form bean's
reset method