• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

optionsCollection display query

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Im totally new to Struts. I have a simple query using

<html ptionsCollection.

This is reading an ArrayList containing LabelValueBean which has 2 key pair values for "YES" & "NO"

My query is : Is there any way I can set the default for which value is displayed. The requirement is that in certain circumstamces the default is to be "YES" in certain other circumstances it is to be "NO". I think at the minute it is taking the natural order of the list.?

Thanks

Mike
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe the list will default to the value that you have set for the form property you are using for your select tag. So If you set that value to "yes" in your action befor the JSP is called, it should default to "yes".
 
reply
    Bookmark Topic Watch Topic
  • New Topic