• 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

Struts 2 s:select has no value

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sure this is something simple but I am getting an arraylist from the database containing last name, first name and a unique id. I am trying to display this arraylist in a select box. Here is the code in my jsp:

<s:select> cssClass="SmallText" label="Choose a Lawyer" name="lawyerENbr" headerKey="-1" headerValue="-- Please Select --" list="lawyerList" listValue="lawyerFirstName" listKey="lawyerENbr" </s:select>


The lawyerList is my arraylist. Right now I am only trying to display the first name until I get it working. I will then get the first name and last name to display.

lawyerFirstName is the first name in my transfer object. lawyerENbr is the unique identifier in my transfer object.

At the moment my select list is empty. Can anyone tell me what I am doing wrong?

Thanks for your help.
 
Ranch Hand
Posts: 83
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like its a typo....your code is this



you need to change it to this



Hope this helps...
 
Katie Doody
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I apologize, that was the code that I had. It is not working. My label shows up but there is nothing in the select list. Can the object in the arraylist have more than the key and the value? Thanks.
 
Katie Doody
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind, I figured out my problem and it was not a struts issue. Thanks for your help!
 
reply
    Bookmark Topic Watch Topic
  • New Topic