• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic