This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes Dynamically generating styleClass value in html:options Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamically generating styleClass value in html:options" Watch "Dynamically generating styleClass value in html:options" New topic
Author

Dynamically generating styleClass value in html:options

Justin jn
Greenhorn

Joined: Feb 02, 2009
Posts: 1
As far as I can see, you can only specify the same styleClass value for all html:options in a collection. I'd like to specify the same value for the "styleClass" attribute as the "property" attribute. Is there a way I can do this either with struts tags or jstl? Thanks for any help.

I'd like to do something as the below example. Note, that the example renders a "class" attribute of the literal string "value" instead of the desired value of getValue() in the LabelValueBean in the labelColorsList.

<html:options collection="labelColorsList" styleClass="value" property="value" labelProperty="label" />
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically generating styleClass value in html:options