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 Retaining the value in struts2 using Select and optionTransferSelect 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 "Retaining the value in struts2 using Select and optionTransferSelect" Watch "Retaining the value in struts2 using Select and optionTransferSelect" New topic
Author

Retaining the value in struts2 using Select and optionTransferSelect

Gurvinder Rayat
Greenhorn

Joined: Dec 28, 2007
Posts: 8
Hi,
I am asking for something which is common, but I am not able to find anything on Google also.
I have successfully implemented Select/OptionTransferSelect Tags, but I am not able to get values in action (which I am calling on submission)
I am looking for some sample code.
Thanks in advance.
Gurvinder

// Thanks for forwarding the links.
I have already implemented the same in way it is mentioned on forwarded links.

<s:select list="modes" multiple="true" name="selectedModes" id="selectedModes" listKey="id" listValue="name" key="mode" cssStyle="WIDTH:200px"/>

I want to know, when I am submitting these values to an action, how to get selected values?
Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Both have examples on the S2 documentation wiki: select, optiontransferselect.

Perhaps simply posting the troublesome code would be enough.
 
 
subject: Retaining the value in struts2 using Select and optionTransferSelect