Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question Re: html:OptionsCollection Tag

 
Jason Ferguson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP defined with using the <html ptionsCollection> tag from the Struts tag library. The code looks something like this:


Unfortunately, the label only puts out the single value, "projectId" (think a select box that just says "166").

Is there any way to adjust the properties of the label, so that maybe the value of the label might have some type of text appended to it? I doubt it is possible, but was wondering...

Jason
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest you add a getter method to the JavaBean you're using in your collection named something like getLabelForProject(). then have this method return whatever it is you want to be displayed. Then simply spcify label="labelForProject" in your optionsCollection tag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic