struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Al Sutton" <al.sut...@alsutton.com>
Subject RE: Render preselected value in <s:select ../>
Date Fri, 28 Dec 2007 19:34:21 GMT
Make sure the value selectedMonth in your action is set to 02. 

-----Original Message-----
From: lei.java@gmail.com [mailto:lei.java@gmail.com] 
Sent: 28 December 2007 19:29
To: Struts Users Mailing List
Subject: Render preselected value in <s:select ../>

Hi all,

This struts code

<s:select lable="Months" name="months" headerKey="-1" headerValue="Select
Month" list="#{'01':'Jan','02':'Feb'}" value="selectedMonth"/>

generates this html code:

<select name="months" id="edit_months">
    <option value="-1">Select Month</option>
    <option value="01">Jan</option>
    <option value="02">Feb</option>
</select>

If I want "Feb" is selected (<option value="02" selected>Feb</option>), how
to do it in the <s:select .../>?

Many thanks.


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


Mime
View raw message