This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically generating styleClass value in html:options

Justin jn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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" />
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic