This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 s:select query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 s:select query" Watch "Struts 2 s:select query" New topic
Author

Struts 2 s:select query

Luke Gee
Greenhorn

Joined: Apr 11, 2012
Posts: 5
Hi all,

Im having a little trouble working out something and was wondering if anyone knows if this can be done and if so how.

So I have a dropdown which will be selection of actions that can be done on each user.

here is the code i have:




the listKey="action" will populate the value of the select with something along the lines of "ceaseAccount.action" etc. These will cause the page to redirect to another where the chosen options can be checked, processed and such. What i need though is to include variables on the action: something like listKey="action" + "?key=<s:text name="userKey"/>&userName=<s:text name="userName"/> giving "ceaseAccount.action?userKey=E9F81F9C-163E-42BB-9F64-20DA646D1679&userName=thisUserName" , so the output would be different for each row in the table. I know my example wont work but i hope it shows what im looking for.

Thanks in advance,

Luke
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

what you can do is use onselect="doAction" attribute of <s:select/> tag which will call and java script method such has


Learning some thing New Every Day
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 s:select query