• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to know if I am doing this right or not

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!