struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <>
Subject Re: Tags in struts
Date Tue, 11 Jul 2006 15:08:52 GMT

Excellent!  For a list box, I believe that you must have at least one 
option selected at any given time.  If you don't want to provide a 
default and force the user to actually select one (and then you can 
validate the user's input to ensure he/she has actually selected a real 
value) then you can do what we did.

For our Time Zone list box, we created the list of time zones and also 
inserted a text label of "Time Zone" with the value of "" into the 
LabelValueBean List and then in the Action that is executed before the 
JSP page is rendered, we set the property on the bean.  So for our time 
zone it would be beanInstance.setTimeZone("").  This defaults our time 
zone list box to display "Time Zone" and if the user tries to submit the 
form without selecting a time zone, our validator informs them that they 
must select a time zone.

Glad it worked.


Maya menon wrote:
> Thanks Adam
>   Implemented it and it worked.
>   One quick question, when we use these tags, one of the options get
> selected by default. How can we modify the tag so that NONE of the
> options get selected by default ?
>   Thanks.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message