Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic