Author: nbelaevski
Date: 2007-11-22 22:16:40 -0500 (Thu, 22 Nov 2007)
New Revision: 4214
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
Log:
saveState & toString moved to base class
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-22
21:18:41 UTC (rev 4213)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-23
03:16:40 UTC (rev 4214)
@@ -341,7 +341,32 @@
return true;
}
return false;
+ },
+
+ getAsString : function() {
+ var result = new Array();
+ for (var i = 0; i < this.shuttleItems.length; i++) {
+ var item = this.shuttleItems[i];
+ result.push(item._id);
+ if (item._selected) {
+ result.push(Richfaces.OrderingList.SELECTION_MARKER);
+ }
+ if (this.activeItem && (this.activeItem.rowIndex == item._node.rowIndex)) {
+ result.push(Richfaces.OrderingList.ACTIVITY_MARKER);
+ }
+ if (i != (this.shuttleItems.length - 1)) {
+ result.push(Richfaces.OrderingList.ITEM_SEPARATOR);
+ }
+ }
+ return result.join("");
+ },
+
+ saveState : function() {
+ if (this.activeItem != null || (this.selectedItems.length > 0)) {
+ this.valueKeeper.value = this.getAsString();
+ }
}
+
}
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-22
21:18:41 UTC (rev 4213)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-23
03:16:40 UTC (rev 4214)
@@ -144,30 +144,6 @@
break;
case 32 : this.invertSelection(event); this.saveState(); break; //blank
}
- },
-
- toString : function() {
- var result = new Array();
- for (var i = 0; i < this.shuttleItems.length; i++) {
- var item = this.shuttleItems[i];
- result.push(item._id);
- if (item._selected) {
- result.push(Richfaces.OrderingList.SELECTION_MARKER);
- }
- if (this.activeItem && (this.activeItem.rowIndex == item._node.rowIndex)) {
- result.push(Richfaces.OrderingList.ACTIVITY_MARKER);
- }
- if (i != (this.shuttleItems.length - 1)) {
- result.push(Richfaces.OrderingList.ITEM_SEPARATOR);
- }
- }
- return result.join("");
- },
-
- saveState : function() {
- if (this.activeItem != null || (this.selectedItems.length > 0)) {
- this.valueKeeper.value = this.toString();
- }
}
});
Show replies by date