[richfaces-svn-commits] JBoss Rich Faces SVN: r12019 - in trunk/ui/listShuttle/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Dec 24 13:52:39 EST 2008


Author: vmolotkov
Date: 2008-12-24 13:52:38 -0500 (Wed, 24 Dec 2008)
New Revision: 12019

Modified:
   trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
   trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
   trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595

Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml	2008-12-24 18:41:33 UTC (rev 12018)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml	2008-12-24 18:52:38 UTC (rev 12019)
@@ -158,6 +158,16 @@
 			<classname>java.lang.String</classname>
 		    <description>HTML: script expression; called after ordering action</description>
 		</property>
+		<property>
+	        <name>onlistchange</name>
+	        <classname>java.lang.String</classname>
+	        <description>A JavaScript event handler called before list change operation</description>
+	    </property>
+		<property>
+			<name>onorderchange</name>
+			<classname>java.lang.String</classname>
+		    <description>HTML: script expression; called before ordering action</description>
+		</property>
 
          <property>
             <name>showButtonLabels</name>

Modified: trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
--- trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js	2008-12-24 18:41:33 UTC (rev 12018)
+++ trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js	2008-12-24 18:52:38 UTC (rev 12019)
@@ -159,21 +159,23 @@
 	},
 	
 	moveItems : function(sourceComponent, targetComponent, items) {
-		if (items.length > 0) {
-			var length = items.length;
-			for (var i = 0; items.length > 0;) {
-				var item = items[i];
-				this.moveItem(sourceComponent, targetComponent, item);
-			} 
-			this.controlListManager();
-			if (this.targetList.controlListManager) {
-				this.targetList.controlListManager();				
+		if (Richfaces.invokeEvent(this.events.onlistchange, this.container, "rich:onlistchange", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems})) {
+			if (items.length > 0) {
+				var length = items.length;
+				for (var i = 0; items.length > 0;) {
+					var item = items[i];
+					this.moveItem(sourceComponent, targetComponent, item);
+				} 
+				this.controlListManager();
+				if (this.targetList.controlListManager) {
+					this.targetList.controlListManager();				
+				}
+				
+				this.targetLayoutManager.widthSynchronization();
+				this.sourceLayoutManager.widthSynchronization();
+			
+				this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
 			}
-			
-			this.targetLayoutManager.widthSynchronization();
-			this.sourceLayoutManager.widthSynchronization();
-		
-			this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
 		}
 	},
 	
@@ -228,18 +230,20 @@
 	},
 	
 	moveItemByClick : function(event, sourceComponent, targetComponent, layoutManager) {
-		var item = this.sourceList.getEventTargetRow(event);
-		this.moveItem(sourceComponent, targetComponent, item);
+		if (Richfaces.invokeEvent(this.events.onlistchange, this.container, "rich:onlistchange", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems})) {
+			var item = this.sourceList.getEventTargetRow(event);
+			this.moveItem(sourceComponent, targetComponent, item);
+			
+			this.controlListManager();
+			if (this.targetList.controlListManager) {
+				this.targetList.controlListManager();
+			}
+			
+			this.targetLayoutManager.widthSynchronization();
+			this.sourceLayoutManager.widthSynchronization();
 		
-		this.controlListManager();
-		if (this.targetList.controlListManager) {
-			this.targetList.controlListManager();
+			this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
 		}
-		
-		this.targetLayoutManager.widthSynchronization();
-		this.sourceLayoutManager.widthSynchronization();
-		
-		this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
 	},
 	
 	copyAll : function() {

Modified: trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx	2008-12-24 18:41:33 UTC (rev 12018)
+++ trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx	2008-12-24 18:52:38 UTC (rev 12019)
@@ -194,6 +194,7 @@
 											[['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']],
 											'#{clientId}sortLabel', 
 											{onorderchanged:#{this:getAsEventHandler(context, component, "onorderchanged")},
+											 onorderchange:#{this:getAsEventHandler(context, component, "onorderchange")},
 											 ontopclick:#{this:getAsEventHandler(context, component, "ontopclick")},
 											 onbottomclick:#{this:getAsEventHandler(context, component, "onbottomclick")},
 											 onupclick:#{this:getAsEventHandler(context, component, "onupclick")},
@@ -215,6 +216,7 @@
 										[['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']],
 										"#{switchByClick}", 
 										{onlistchanged:#{this:getAsEventHandler(context, component, "onlistchanged")},
+										 onlistchange:#{this:getAsEventHandler(context, component, "onlistchange")},
 										 oncopyallclick:#{this:getAsEventHandler(context, component, "oncopyallclick")},
 										 oncopyclick:#{this:getAsEventHandler(context, component, "oncopyclick")},
 										 onremoveallclick:#{this:getAsEventHandler(context, component, "onremoveallclick")},




More information about the richfaces-svn-commits mailing list