Is there any way you could mail me sample code for this Options tag?

Thanks,
David


                                                                                       
                                             
              shirishchandra.sakhare@ubs.                                              
                                             
              com                                 To:      
[EMAIL PROTECTED]                                           
                                                  cc:                                  
                                             
              12/12/2002 12:33                    Subject: RE: dropdowns being reset   
                                             
              Please respond to "Struts                                                
                                             
              Users Mailing List"                                                      
                                             
                                                                                       
                                             
                                                                                       
                                             



try using html:options instead..and supply it with the collection or array
of
indexes...

because if in html:select u specify property attribute, and the property is

there in the request(which should be the case when u forward the request
back
to same jsp with errors..),the same is used to preselect a element.
I think may be as u are using html:ootion in a loop, u are having this
problem.

regards,
Shirish

-----Original Message-----
From: david.heagney [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 1:17 PM
To: struts-user; david.heagney
Subject: dropdowns being reset


Hi,

I have a page in my STRUTS app which dynamically populates a dropdown list:

Month

<html:select property="fromMonth">
<option value="--">--
<% for (int i=1; i <= 12; i++) { %>
      <option value="<%= i %>"><%= getMonthName (i) %>
<% } %>
</html:select>

getMonthName() returns the month as a string based in the passed integer, 1
- 12.

If the user submits the form and leaves out a required field, the above
dropdown gets re-set, i.e. doesn't retain the selection when the page is
refreshed with it's errors... does anyone know how i can avoid this?

Thanks,
David


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.


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



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




This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.


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

Reply via email to