Commits

Anonymous committed d19d1a9

WW-1440
- Multiple forms cause conflicting customOnSubmit() functions to be created
- an example in showcase using multiple forms within it containing optiontransferselect tags (simulating this issue)

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2888573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (3)

webapps/showcase/src/webapp/WEB-INF/classes/xwork-tags-ui.xml

         	<result name="input">lotsOfRichtexteditor.jsp</result>
 			<result>lotsOfRichtexteditorSubmit.jsp</result>        
         </action>
+        <action name="optiontransferselectInMultipleForms" class="com.opensymphony.webwork.showcase.LotsOfOptiontransferselectAction" method="input">
+        	<result>optiontransferselect_multipleform.jsp</result>
+        </action>
+        <action name="optiontransferselectInMultipleFormsSubmit" class="com.opensymphony.webwork.showcase.LotsOfOptiontransferselectAction" method="submit">
+        	<result name="input">optiontransferselect_multipleform.jsp</result>
+			<result>lotsOfOptiontransferselectSubmit.jsp</result>        
+        </action>
         <action name="tooltipExample">
         	<result>tooltipExample.jsp</result>
         </action>

webapps/showcase/src/webapp/tags/ui/index.jsp

 		<li><ww:url id="url" namespace="/tags/ui" action="example" method="input" /><ww:a href="%{url}">UI Example</ww:a></li>
 		<li><ww:url id="url" namespace="/tags/ui" action="exampleVelocity" method="input" /><ww:a href="%{url}">UI Example (Velocity)</ww:a></li>
 		<li><ww:url id="url" namespace="/tags/ui" action="lotsOfOptiontransferselect" method="input" /><ww:a href="%{url}">Option Transfer Select UI Example</ww:a></li>
+		<li><ww:url id="url" namespace="/tags/ui" action="optiontransferselectInMultipleForms" /><ww:a href="%{#url}">Option Transfer Select UI Example (multiple forms)</ww:a></li>
 		<li><ww:url id="url" namespace="/tags/ui" action="lotsOfRichtexteditor" method="input" /><ww:a href="%{url}">Rich Text Editor UI Example</ww:a></li>
 		<li><ww:url id="url" namespace="/tags/ui" value="treeExampleStatic.jsp" /><ww:a href="%{url}">Tree Example (static)</ww:a>
 		<li><ww:url id="url" namespace="/tags/ui" action="showDynamicTreeAction"/><ww:a href="%{url}">Tree Example (dynamic)</ww:a>

webapps/showcase/src/webapp/tags/ui/optiontransferselect_multipleform.jsp

+<%@taglib prefix="ww" uri="/webwork" %>
+
+<html>
+<head>
+<title>Show Case - Tags - UI Tags - Optiontransferselect</title>
+<ww:head />
+</head>
+<body>
+
+<ww:form id="f1" action="optiontransferselectInMultipleFormsSubmit" namespace="/tags/ui" method="post">
+	<ww:optiontransferselect 
+		tooltip="Select Your Favourite Cartoon Characters"
+		headerKey="-1"
+		headerValue="--- Please Select ---"
+		doubleHeaderKey="-1"
+		doubleHeaderValue="--- Please Select ---"
+		emptyOption="true"
+		doubleEmptyOption="true"
+		label="Favourite Cartoon Characters"
+		leftTitle="Favourite Cartoon Characters"
+		rightTitle="Non Favourite Cartoon Characters"
+		name="favouriteCartoonCharacters" 
+		list="defaultFavouriteCartoonCharacters" 
+		doubleName="notFavouriteCartoonCharacters"
+		doubleList="defaultNotFavouriteCartoonCharacters" />
+		
+	<br/>	
+	<ww:submit />
+</ww:form>
+	
+<ww:form id="f2" action="optiontransferselectInMultipleFormsSubmit" namespace="/tags/ui" method="post">
+	<ww:optiontransferselect
+		tooltip="Select Your Favourite Cars"
+		label="Favourite Cars"
+		leftTitle="Favourite Cars"
+		rightTitle="Non Favourite Cars"
+		name="favouriteCars"
+		list="defaultFavouriteCars"
+		doubleName="notFavouriteCars"
+		doubleList="defaultNotFavouriteCars" />
+		
+	<br/>
+		
+	<ww:optiontransferselect 
+		tooltip="Select Your Favourite Motorcycles"
+		headerKey="-1"
+		headerValue="--- Please Select ---"
+		doubleHeaderKey="-1"
+		doubleHeaderValue="--- Please Select ---"
+		label="Favourite Motorcycles"
+		leftTitle="Favourite Motorcycles"
+		rightTitle="Non Favourite Motorcycles"
+		name="favouriteMotorcycles" 
+		list="defaultFavouriteMotorcycles"
+		doubleName="notFavouriteMotorcycles"
+		doubleList="defaultNotFavouriteMotorcycles" />
+		
+	<br/>
+		
+	<ww:optiontransferselect 
+		tooltip="Select Your Favourite Countries"
+		emptyOption="true"
+		doubleEmptyOption="true"
+		label="Favourite Countries"
+		leftTitle="Favourite Countries"
+		rightTitle="Non Favourite Countries"
+		name="favouriteCountries" 
+		list="defaultFavouriteCountries" 
+		doubleName="notFavouriteCountries" 
+		doubleList="defaultNotFavouriteCountries"
+		  /> 
+		
+	<br/>	
+	
+	<ww:updownselect 
+		tooltip="Prioritized Your Favourite Cartoon Characters"
+		label="Prioritised Favourite Cartoon Characters"
+		list="defaultFavouriteCartoonCharacters" 
+		name="prioritisedFavouriteCartoonCharacters" 
+		headerKey="-1" 
+		headerValue="--- Please Order ---" 
+		emptyOption="true"  />	
+		
+	<br/>
+		
+	<ww:updownselect
+		tooltip="Prioritise Your Favourite Cars"
+		label="Prioritised Favourite Cars"
+		list="defaultFavouriteCars"
+		name="prioritisedFavouriteCars" 
+		headerKey="-10" 
+		headerValue="--- Please Order ---" />
+		
+	<br/>
+		
+	<ww:updownselect 
+		tooltip="Prioritised Your Favourite Countries"
+		label="Prioritised Favourite Countries"
+	    list="defaultFavouriteCountries"
+	    name="prioritisedFavouriteCountries" 
+	    emptyOption="true" 
+	    value="{'england', 'brazil'}" />	
+		
+	<br/>
+	
+	<ww:submit value="Submit It" />
+	
+	<br/>
+	
+</ww:form>
+
+</body>