This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes html:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:select" Watch "html:select" New topic
Author

html:select

Satish Kulkarni
Ranch Hand

Joined: Jul 19, 2003
Posts: 60
I have the following html:select
<html:select property="curruserlist" size="5" multiple="true" >
<html ptions name="<%=Constants.CURR_USER_NAMES%>" labelName="<%=Constants.CURR_USERS%>" />
</html:select>
I want everything in this to be selected by default.
Any idea
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4456
    
    6

Assuming that you are following the best practice of always going through Actions first, you need to set the ActionForm's curruserlist to an array that contains all values that you want selected. You do this before you forward to the JSP that displays the select. Struts will take care of the rest.


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:select