wood burning stoves 2.0*
The moose likes Struts and the fly likes Default selected value in optionsCollection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Default selected value in optionsCollection" Watch "Default selected value in optionsCollection" New topic
Author

Default selected value in optionsCollection

M Flournoy
Greenhorn

Joined: Dec 20, 2006
Posts: 1
I know similar questions have been asked before, and I apologize, but I wasn't able to figure my problem out based on those.

I need to modify existing JSP code to have an option from a selection box be selected by default. The code I am using looks like this:



This code successfully creates the selection box and populates it accordingly, but it does not set any option as selected. The option I want to set as selected is exactly the "selDate" variable (pulled down from "pref" in the URL).

What modifications do I need to make?

Thanks,
MRF
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

As you are using Struts tags to implement the select element, I have moved this post to the Struts forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The answer to this question is found in the JavaRanch Struts FAQ. If after reading this, you still can't figure it out, let us know and we'll help you.


Merrill
Consultant, Sima Solutions
 
 
subject: Default selected value in optionsCollection