This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Html:options: value to be different from display on jsp page

 
Luke Zechariah
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application is in struts. For a drop down I am using

<html ptions collection="examiners" property="value"
labelProperty="label" />

While displaying on the jsp, the output on the drop down needs to be
such as this:
jak
abc
lmn
jpp
jal

But when we right-click and view source, I want the values to be different from what is being displayed such as:
jak_1P
abc_4A
lmn_re
jpp_9A
jal_7S

Can anyone please let me know how this can be done using struts <html ptions>. Thanks in advance.
Luke.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code you showed us looks OK to me. Are you saying it doesn't work? If "examiners" is a collection of LabelValueBean objects, your code should produce a select box in which the values are different from the labels.
 
Luke Zechariah
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merill, I found out what the constructor for labelValuebean meant i.e one is label the other is the value and it resolved my problem.

Lz.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic