myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1422867 - in /myfaces/tomahawk/trunk: core/src/main/java/org/apache/myfaces/custom/picklist/ core/src/main/resources/org/apache/myfaces/custom/picklist/resource/ core20/src/main/java/org/apache/myfaces/custom/picklist/ core20/src/main/java...
Date Mon, 17 Dec 2012 11:45:36 GMT
Author: werpu
Date: Mon Dec 17 11:45:35 2012
New Revision: 1422867

URL: http://svn.apache.org/viewvc?rev=1422867&view=rev
Log:
 TOMAHAWK-1649

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/picklist/resource/picklist.js
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
    myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.picklist/picklist.js

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java?rev=1422867&r1=1422866&r2=1422867&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
Mon Dec 17 11:45:35 2012
@@ -56,10 +56,10 @@ import org.apache.myfaces.shared_tomahaw
 public class HtmlPicklistRenderer extends HtmlListboxRendererBase
 {
 
-    private static final String FUNCTION_ADD_TO_SELECTED = "myfaces_picklist_addToSelected";
-    private static final String FUNCTION_ADD_ALL_TO_SELECTED = "myfaces_picklist_addAllToSelected";
   
-    private static final String FUNCTION_REMOVE_FROM_SELECTED = "myfaces_picklist_removeFromSelected";
-    private static final String FUNCTION_REMOVE_ALL_FROM_SELECTED = "myfaces_picklist_removeAllFromSelected";
+    private static final String FUNCTION_ADD_TO_SELECTED = "org.apache.myfaces.Picklist.addToSelected";
+    private static final String FUNCTION_ADD_ALL_TO_SELECTED = "org.apache.myfaces.Picklist.addAllToSelected";
   
+    private static final String FUNCTION_REMOVE_FROM_SELECTED = "org.apache.myfaces.Picklist.removeFromSelected";
+    private static final String FUNCTION_REMOVE_ALL_FROM_SELECTED = "org.apache.myfaces.Picklist.removeAllFromSelected";
 
     private static final String AVAILABLE_SUFFIX = "_AVAILABLE";
     private static final String SELECTED_SUFFIX = "_SELECTED";

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/picklist/resource/picklist.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/picklist/resource/picklist.js?rev=1422867&r1=1422866&r2=1422867&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/picklist/resource/picklist.js
(original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/picklist/resource/picklist.js
Mon Dec 17 11:45:35 2012
@@ -16,87 +16,93 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
- /**
+
+/**
  * @author Bruno Aranda (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
- 
+
+window.org = window.org || {};
+org.apache = org.apache || {};
+org.apache.myfaces = org.apache.myfaces || {};
+
+if (!org.apache.myfaces.Picklist) {
+    org.apache.myfaces.Picklist = {};
+
 // moves all the items to the selected list
-function myfaces_picklist_addAllToSelected(availableListId, selectedListId, hiddenId)
-{
-	var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_moveAll(availableList, selectedList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
+    org.apache.myfaces.Picklist.addAllToSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.moveAll(availableList, selectedList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
 
 // removes all the items from the selected list
-function myfaces_picklist_removeAllFromSelected(availableListId, selectedListId, hiddenId)
-{
-    var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_moveAll(selectedList, availableList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
+    org.apache.myfaces.Picklist.removeAllFromSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.moveAll(selectedList, availableList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
 
 // moves an item to the selected list
-function myfaces_picklist_addToSelected(availableListId, selectedListId, hiddenId)
-{
-	var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_move(availableList, selectedList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
+    org.apache.myfaces.Picklist.addToSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.move(availableList, selectedList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
 
 // removes an item from the selected list
-function myfaces_picklist_removeFromSelected(availableListId, selectedListId, hiddenId)
-{
-    var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_move(selectedList, availableList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
-
-function myfaces_picklist_move(fromList, toList, hiddenId) {
-	// Return, if no items selected
-	var selectedIndex = fromList.selectedIndex;
-	if(selectedIndex < 0) { return; }
-
-	// Decremental loop, so the index is not affected in the moves
-	for (var i = fromList.options.length - 1; i >= 0; i--) {
-		if(fromList.options[i].selected) {
-			var tLen = toList.options.length;
-			toList.options[tLen] = new Option(fromList.options[i].text);
-			toList.options[tLen].value = fromList.options[i].value;
-			fromList.options[i] = null;
-		}
-	}
-}
-
-function myfaces_picklist_moveAll(fromList, toList, hiddenId) {
-
-	// Decremental loop, so the index is not affected in the moves
-	for (var i = fromList.options.length - 1; i >= 0; i--) {
-		var tLen = toList.options.length;
-		toList.options[tLen] = new Option(fromList.options[i].text);
-		toList.options[tLen].value = fromList.options[i].value;
-		fromList.options[i] = null;
-	}
-}
+    org.apache.myfaces.Picklist.removeFromSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.move(selectedList, availableList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
+
+    org.apache.myfaces.Picklist.move = function (fromList, toList, hiddenId) {
+        // Return, if no items selected
+        var selectedIndex = fromList.selectedIndex;
+        if (selectedIndex < 0) {
+            return;
+        }
+
+        // Decremental loop, so the index is not affected in the moves
+        for (var i = fromList.options.length - 1; i >= 0; i--) {
+            if (fromList.options[i].selected) {
+                var tLen = toList.options.length;
+                toList.options[tLen] = new Option(fromList.options[i].text);
+                toList.options[tLen].value = fromList.options[i].value;
+                fromList.options[i] = null;
+            }
+        }
+    };
+
+    org.apache.myfaces.Picklist.moveAll = function (fromList, toList, hiddenId) {
+
+        // Decremental loop, so the index is not affected in the moves
+        for (var i = fromList.options.length - 1; i >= 0; i--) {
+            var tLen = toList.options.length;
+            toList.options[tLen] = new Option(fromList.options[i].text);
+            toList.options[tLen].value = fromList.options[i].value;
+            fromList.options[i] = null;
+        }
+    };
 
 // Selection - invoked on submit
-function myfaces_picklist_updateHidden(selectedList, hiddenId) {
-	var hiddenField = document.getElementById(hiddenId);
-	
-	var arrValues = new Array(selectedList.options.length);
-	for (var i = 0; i<selectedList.options.length; i++) {
-	    arrValues[i] = selectedList.options[i].value;
-	}
-	
-	hiddenField.value = arrValues.join();
+    org.apache.myfaces.Picklist.updateHidden = function(selectedList, hiddenId) {
+        var hiddenField = document.getElementById(hiddenId);
+
+        var arrValues = new Array(selectedList.options.length);
+        for (var i = 0; i < selectedList.options.length; i++) {
+            arrValues[i] = selectedList.options[i].value;
+        }
+
+        hiddenField.value = arrValues.join();
+    };
 }
\ No newline at end of file

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java?rev=1422867&r1=1422866&r2=1422867&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
(original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/picklist/HtmlPicklistRenderer.java
Mon Dec 17 11:45:35 2012
@@ -59,10 +59,10 @@ import org.apache.myfaces.shared_tomahaw
 public class HtmlPicklistRenderer extends HtmlListboxRendererBase
 {
 
-    private static final String FUNCTION_ADD_TO_SELECTED = "myfaces_picklist_addToSelected";
-    private static final String FUNCTION_ADD_ALL_TO_SELECTED = "myfaces_picklist_addAllToSelected";
   
-    private static final String FUNCTION_REMOVE_FROM_SELECTED = "myfaces_picklist_removeFromSelected";
-    private static final String FUNCTION_REMOVE_ALL_FROM_SELECTED = "myfaces_picklist_removeAllFromSelected";
+    private static final String FUNCTION_ADD_TO_SELECTED = "org.apache.myfaces.Picklist.addToSelected";
+    private static final String FUNCTION_ADD_ALL_TO_SELECTED = "org.apache.myfaces.Picklist.addAllToSelected";
+    private static final String FUNCTION_REMOVE_FROM_SELECTED = "org.apache.myfaces.Picklist.removeFromSelected";
+    private static final String FUNCTION_REMOVE_ALL_FROM_SELECTED = "org.apache.myfaces.Picklist.removeAllFromSelected";
 
     private static final String AVAILABLE_SUFFIX = "_AVAILABLE";
     private static final String SELECTED_SUFFIX = "_SELECTED";

Modified: myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.picklist/picklist.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.picklist/picklist.js?rev=1422867&r1=1422866&r2=1422867&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.picklist/picklist.js (original)
+++ myfaces/tomahawk/trunk/core20/src/main/javascript/oam.custom.picklist/picklist.js Mon
Dec 17 11:45:35 2012
@@ -16,87 +16,93 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
- /**
+
+/**
  * @author Bruno Aranda (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
- 
+
+window.org = window.org || {};
+org.apache = org.apache || {};
+org.apache.myfaces = org.apache.myfaces || {};
+
+if (!org.apache.myfaces.Picklist) {
+    org.apache.myfaces.Picklist = {};
+
 // moves all the items to the selected list
-function myfaces_picklist_addAllToSelected(availableListId, selectedListId, hiddenId)
-{
-	var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_moveAll(availableList, selectedList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
+    org.apache.myfaces.Picklist.addAllToSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.moveAll(availableList, selectedList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
 
 // removes all the items from the selected list
-function myfaces_picklist_removeAllFromSelected(availableListId, selectedListId, hiddenId)
-{
-    var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_moveAll(selectedList, availableList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
+    org.apache.myfaces.Picklist.removeAllFromSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.moveAll(selectedList, availableList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
 
 // moves an item to the selected list
-function myfaces_picklist_addToSelected(availableListId, selectedListId, hiddenId)
-{
-	var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_move(availableList, selectedList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
+    org.apache.myfaces.Picklist.addToSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.move(availableList, selectedList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
 
 // removes an item from the selected list
-function myfaces_picklist_removeFromSelected(availableListId, selectedListId, hiddenId)
-{
-    var availableList = document.getElementById(availableListId);
-    var selectedList = document.getElementById(selectedListId);
-
-	myfaces_picklist_move(selectedList, availableList, hiddenId);
-	myfaces_picklist_updateHidden(selectedList, hiddenId);
-}
-
-function myfaces_picklist_move(fromList, toList, hiddenId) {
-	// Return, if no items selected
-	var selectedIndex = fromList.selectedIndex;
-	if(selectedIndex < 0) { return; }
-
-	// Decremental loop, so the index is not affected in the moves
-	for (var i = fromList.options.length - 1; i >= 0; i--) {
-		if(fromList.options[i].selected) {
-			var tLen = toList.options.length;
-			toList.options[tLen] = new Option(fromList.options[i].text);
-			toList.options[tLen].value = fromList.options[i].value;
-			fromList.options[i] = null;
-		}
-	}
-}
-
-function myfaces_picklist_moveAll(fromList, toList, hiddenId) {
-
-	// Decremental loop, so the index is not affected in the moves
-	for (var i = fromList.options.length - 1; i >= 0; i--) {
-		var tLen = toList.options.length;
-		toList.options[tLen] = new Option(fromList.options[i].text);
-		toList.options[tLen].value = fromList.options[i].value;
-		fromList.options[i] = null;
-	}
-}
+    org.apache.myfaces.Picklist.removeFromSelected = function (availableListId, selectedListId,
hiddenId) {
+        var availableList = document.getElementById(availableListId);
+        var selectedList = document.getElementById(selectedListId);
+
+        org.apache.myfaces.Picklist.move(selectedList, availableList, hiddenId);
+        org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId);
+    };
+
+    org.apache.myfaces.Picklist.move = function (fromList, toList, hiddenId) {
+        // Return, if no items selected
+        var selectedIndex = fromList.selectedIndex;
+        if (selectedIndex < 0) {
+            return;
+        }
+
+        // Decremental loop, so the index is not affected in the moves
+        for (var i = fromList.options.length - 1; i >= 0; i--) {
+            if (fromList.options[i].selected) {
+                var tLen = toList.options.length;
+                toList.options[tLen] = new Option(fromList.options[i].text);
+                toList.options[tLen].value = fromList.options[i].value;
+                fromList.options[i] = null;
+            }
+        }
+    };
+
+    org.apache.myfaces.Picklist.moveAll = function (fromList, toList, hiddenId) {
+
+        // Decremental loop, so the index is not affected in the moves
+        for (var i = fromList.options.length - 1; i >= 0; i--) {
+            var tLen = toList.options.length;
+            toList.options[tLen] = new Option(fromList.options[i].text);
+            toList.options[tLen].value = fromList.options[i].value;
+            fromList.options[i] = null;
+        }
+    };
 
 // Selection - invoked on submit
-function myfaces_picklist_updateHidden(selectedList, hiddenId) {
-	var hiddenField = document.getElementById(hiddenId);
-	
-	var arrValues = new Array(selectedList.options.length);
-	for (var i = 0; i<selectedList.options.length; i++) {
-	    arrValues[i] = selectedList.options[i].value;
-	}
-	
-	hiddenField.value = arrValues.join();
+    org.apache.myfaces.Picklist.updateHidden = function(selectedList, hiddenId) {
+        var hiddenField = document.getElementById(hiddenId);
+
+        var arrValues = new Array(selectedList.options.length);
+        for (var i = 0; i < selectedList.options.length; i++) {
+            arrValues[i] = selectedList.options[i].value;
+        }
+
+        hiddenField.value = arrValues.join();
+    };
 }
\ No newline at end of file



Mime
View raw message