aspose file tools*
The moose likes Struts and the fly likes Html:options:  value to be different from display on jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Html:options:  value to be different from display on jsp page" Watch "Html:options:  value to be different from display on jsp page" New topic
Author

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

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 120
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

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 120
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Html:options: value to be different from display on jsp page