• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Need to know if I am doing this right or not

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey everyone, lots of people are having <s:select> tag,
I am having problems too but I feel like I am just one mistake away from the success

here is my action class



I would like someone to tell me if my setEmployeeType() is correct
because my drop-down is empty

here is the JSP



the URL to access it is http://localhost:8080/Pay_Roll/Pay_Roll/Action/Register.action

am I missing anything required attribute in <s:select> tag?

thanks for your help

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got my drop-down list to work

I think I was missing listKey="key"
attribute

Anyways, I got it to work
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
setEmployeeType() is never called, so it's not doing what you think it will.

You need to initialize the list before hitting the JSP page: the "list" attribute is the list from which the select tag gets its values, for example in the execute() method, etc.
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr. Newton

Yes, you're right about that, I actually did move the list init to within execute() method

so it worked

Thanks
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic