[
https://issues.apache.org/jira/browse/WW-4804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16053978#comment-16053978
]
Stephe commented on WW-4804:
----------------------------
See update - had to try and trim it down. The real class is massive.
> inputtransferselect does not auto-select its elements
> -----------------------------------------------------
>
> Key: WW-4804
> URL: https://issues.apache.org/jira/browse/WW-4804
> Project: Struts 2
> Issue Type: Bug
> Components: Core Tags
> Affects Versions: 2.5.10
> Reporter: Stephe
> Priority: Minor
> Labels: newbie
> Fix For: 2.5.next
>
>
> I assume that this is a bug though and I am using the tag correctly.
> I have been trying to use the inputtransferselect tag. I created the
> component in my form and it renders on the page fine. However the
> documentation [link
> here|http://struts.apache.org/docs/inputtransferselect.html] states that it
> "Will auto-select all its elements upon its containing form submission."
> However based on my attempts this is not the case. You need to select each
> entry which is added for them to come through to the action.
> Ideally I'd post all of the code but I'll need to cut it down because it's
> corporate (hopefully that won't hide what's going wrong)
> Action class:
> {code:java}
> public class MyAction implements Preparable
> {
> private List<String> myList= new ArrayList<>();
> public List<String> getMyList()
> {
> return this.dependants;
> }
> public void setMyList(List<String> pDependants)
> {
> this.dependants = pDependants;
> }
> @Override
> public void prepare() throws Exception
> {
> // Populates my list from session memory, this works fine...
> }
> @Override
> @Actions({
> @Action(
> value = "/" + ActionPathConstants.SAVE,
> interceptorRefs = @InterceptorRef(
> value = "defaultSecurityStack",
> params = {
> "tokenSession.includeMethods",
> "*" }),
> results = {
> @Result(
> type = "redirectAction",
> name = ActionPathConstants.SUCCESS,
> location = ActionPathConstants.NEXT_PAGE),
> }) })
> public String save() throws Exception
> {
> // This maps the value of myList back to session memory
> }
> }
> {code}
> JSP file:
> {code:jsp}
> <s:form id="myPageSave" action="myPageSave" method="post">
> <s:inputtransferselect
> label="myList"
> name="myList"
> addLabel="Add"
> removeLabel="Remove"
> removeAllLabel="Remove all"
> allowUpDown="false"
> leftTitle="Input item"
> rightTitle="Existing items"
> list="myList"
> />
> </s:form>
> {code}
> Note that the from is submitted via javascript. Rather than by directly
> pressing a submit button. Could this have any impact on how the auto select
> works?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)