Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically generating styleClass value in html:options  RSS feed

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" />
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!