• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

html:select - how do I select an option in the down other than the first option

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this simple drop down in my jsp page which retrieves the list of the values to be displayed in a collection. When it displays, by default the first entry in the drop down is selected. How would I make some other entry selected by default when the page displays, other than the first one.

I would appreciate if anyone could help me fix this.

 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since the <html:select> tag automatically selects the option that matches the value of the form bean property you specify, do one of the following:

1-Override the reset(..) method in your Action form and add the statement:
setCaseStatusI("2");

2-In the Action class that forwards to this JSP, set the caseStatusI property in a similar manner.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic