Author: nbelaevski
Date: 2008-01-07 14:54:46 -0500 (Mon, 07 Jan 2008)
New Revision: 5160
Modified:
trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
Log:
http://jira.jboss.com/jira/browse/RF-1841
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-01-07
19:49:18 UTC (rev 5159)
+++
trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2008-01-07
19:54:46 UTC (rev 5160)
@@ -44,6 +44,10 @@
Richfaces.ListShuttle.prototype = {
initialize: function(targetList, sourceList, clientId, controlIds, switchByClick,
sourceLayoutManager, targetLayoutManager, onlistchanged) {
this.containerId = clientId;
+
+ this.container = $(this.containerId);
+ this.container.component = this;
+
this.targetList = targetList;
this.sourceList = sourceList;
@@ -75,10 +79,16 @@
if (onlistchanged) {
this.targetList.container.observe("rich:onorderchanged", onlistchanged);
- $(this.containerId).observe("rich:onlistchanged", onlistchanged);
+ this.container.observe("rich:onlistchanged", onlistchanged);
}
},
+ destroy: function() {
+ this.container.component = null;
+ this.targetList.destroy();
+ this.sourceList.destroy();
+ },
+
initControlList : function(clientId, ids) {
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
@@ -150,7 +160,7 @@
this.targetLayoutManager.widthSynchronization();
this.sourceLayoutManager.widthSynchronization();
- $(this.containerId).fire("rich:onlistchanged", {});
+ this.container.fire("rich:onlistchanged", {});
}
},
@@ -217,7 +227,7 @@
this.targetLayoutManager.widthSynchronization();
this.sourceLayoutManager.widthSynchronization();
- $(this.containerId).fire("rich:onlistchanged", {});
+ this.container.fire("rich:onlistchanged", {});
}
}