You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jan Hornbøll Hansen (JIRA)" <ji...@apache.org> on 2007/06/06 17:26:26 UTC

[jira] Created: (WW-1972)
<s:optiontransferselect ... items not autoselected on submit.
-------------------------------------------------------------

                 Key: WW-1972
                 URL: https://issues.apache.org/struts/browse/WW-1972
             Project: Struts 2
          Issue Type: Bug
         Environment: WindowsXP, Java 1.6, Tomcat v5.5
            Reporter: Jan Hornbøll Hansen


Have form like:
<s:form action="addUser" method="get">
	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
	</s:optiontransferselect>
	<s:submit type="button" value="%{'add'}">
		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
	</s:submit>
</s:form>

AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work stopped: (WW-1972) Posted by "Jan Hornbøll Hansen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on WW-1972 stopped by Jan Hornbøll Hansen.

> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (WW-1972) Posted by "Jan Hornbøll Hansen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on WW-1972 started by Jan Hornbøll Hansen.

> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1972) Posted by "Mario Matias Urbieta (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44893#action_44893 ] 

Mario Matias Urbieta commented on WW-1972:
------------------------------------------

This is the second work arround that i had to do today. I'll never use this framework again.
The main problem is that dojo plugin uses dojo to send the form in a ajax way and many struts2 components spect a
dom submit event- such as optiontransferselect-  that allows listeners to select the comprised items.
So i emulated the traditional form submition by the following steps avoiding refactoring the xhtml tags:

* Add a listener to the form for stopping the dom submit event bubble. This is the key, i supposed that this listener will be the last executed ( it worked on FF3 and  IE7).
* Fire on submit event. this will excercise the listeners but will be stoped by our listener.

This JS goes at the ajax form

dojo.event.topic.subscribe("/selectAll",
		function(widget, event) {
			StrutsUtils.addEventListener(document.getElementById('${parameters.id}'), "submit", 
		function(evt) {
	dojo.event.browser.stopEvent(evt);
		}, true);
				
			fire('submit',document.getElementById('${parameters.id}'));	
				

		});



function fire(evttype,el) {
    if (document.createEvent) {
      var evt = document.createEvent('HTMLEvents');
      evt.initEvent( evttype, true, true);
      el.dispatchEvent(evt);
    } else if (document.createEventObject) {
      el.fireEvent('on' + evttype);
    }
}



and finally i had to add the following attribute to the ajax submit tag wich triggers the emulation behavior.

beforeNotifyTopics="/selectAll"

this work arround is oblivious and seamless.


> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>             Fix For: Future
>
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1972) Posted by "suman lohani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46557#action_46557 ] 

suman lohani commented on WW-1972:
----------------------------------

This problem still exists in struts 2.0.11.
I am trying the work around suggested by Mario Matias Urbieta. In that code we we replace ${parameters.id with any specific parameter or just use as is. Any suggestions is appreciated.

> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>             Fix For: Future
>
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WW-1972) Posted by "Jan Hornbøll Hansen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Hornbøll Hansen reassigned WW-1972:
---------------------------------------

    Assignee: Jan Hornbøll Hansen

Not a bug (except maybe in documentation) dojo.js not mentioned anywhere in tag reference even though atleast some tags rely on it.

> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (WW-1972) Posted by "suman lohani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46557#action_46557 ] 

suman lohani edited comment on WW-1972 at 8/3/09 4:17 PM:
----------------------------------------------------------

This problem still exists in struts 2.0.11.
I am trying the work around suggested by Mario Matias Urbieta. In that code do we replace ${parameters.id with any specific parameter or just use as is. Any suggestions is appreciated.

      was (Author: suman):
    This problem still exists in struts 2.0.11.
I am trying the work around suggested by Mario Matias Urbieta. In that code we we replace ${parameters.id with any specific parameter or just use as is. Any suggestions is appreciated.
  
> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>             Fix For: Future
>
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1972) Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted updated WW-1972:
---------------------------

    Fix Version/s: Future

Setting Fix Version to "future" for issues without a set fix version. 


> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>             Fix For: Future
>
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1972) Posted by "Thorsten Schäfer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42817 ] 

Thorsten Schäfer commented on WW-1972:
--------------------------------------

It took me some time to understand that the items in the select box need to be selected in order to be submitted. This should be added to the documentation and it should be stated that you need to add <s:head/> to the header in order to get autoselect working.

> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>             Fix For: Future
>
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1972) Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-1972:
-----------------------------

    Component/s: Views

> <s:optiontransferselect ... items not autoselected on submit.
> -------------------------------------------------------------
>
>                 Key: WW-1972
>                 URL: https://issues.apache.org/struts/browse/WW-1972
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>         Environment: WindowsXP, Java 1.6, Tomcat v5.5
>            Reporter: Jan Hornbøll Hansen
>            Assignee: Jan Hornbøll Hansen
>             Fix For: Future
>
>
> Have form like:
> <s:form action="addUser" method="get">
> 	<s:textfield name="user.username"><s:param name="label"><fmt:message key="user.label.username"/></s:param></s:textfield>
> 	<s:password name="user.password"><s:param name="label"><fmt:message key="user.label.password"/></s:param></s:password>
> 	<s:optiontransferselect name="user.roles" list="user.roles" listKey="id" listValue="name" doubleName="roleList" doubleList="roleList" doubleListKey="id" doubleListValue="name">
> 	</s:optiontransferselect>
> 	<s:submit type="button" value="%{'add'}">
> 		<s:param name="label"><fmt:message key="global.label.add"/></s:param>
> 	</s:submit>
> </s:form>
> AddUserAction implements ParameterAware. When form submitted only parameters received are user.username & user.password. Tag reference for <s:optiontransferselect> states that all values in both lists are supposed to be selected before submit (so they'd also be added as parameters).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.