struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maya menon <>
Subject Re: Tags in struts
Date Wed, 12 Jul 2006 13:20:36 GMT
  Thanks for the suggestion. I checked with our users, they didnt like the idea of inserting
a text in the listbox. They see it as confusing.
  So, ideally my users lik to have listboxes with No values selected...
  Any idea how it can be achieved ?

Adam Gordon <> wrote:

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:

Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message