aspose file tools*
The moose likes Struts and the fly likes Selecting value in html:optionCollections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Selecting value in html:optionCollections" Watch "Selecting value in html:optionCollections" New topic
Author

Selecting value in html:optionCollections

chetan kokil
Greenhorn

Joined: Sep 02, 2006
Posts: 9
Hello

I am a newbie to struts and want to know, how to keep selected a particular value in
<html ptionsCollection />


Expecting a favourable reply.

Thanking you
Heartly4u
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181


In this example, your form bean should have a method called "getSelectedValue" and if the value of anything in your collection matches that value, it will be selected.
[ June 05, 2007: Message edited by: Dom Lassy ]
chetan kokil
Greenhorn

Joined: Sep 02, 2006
Posts: 9
Can you send me the code please...if you can...
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
In your action/action form set the default select value to the desired value.
 
jQuery in Action, 2nd edition
 
subject: Selecting value in html:optionCollections