Author: vmolotkov
Date: 2007-12-06 13:05:25 -0500 (Thu, 06 Dec 2007)
New Revision: 4565
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
bugs: RF-1541, RF-1528
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
---
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-06
17:27:03 UTC (rev 4564)
+++
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-06
18:05:25 UTC (rev 4565)
@@ -51,7 +51,7 @@
};
Richfaces.ListShuttle.prototype = {
- initialize: function(targetList, sourceList, clientId, controlIds, switchByClick) {
+ initialize: function(targetList, sourceList, clientId, controlIds, switchByClick,
sourceLayoutManager, targetLayoutManager) {
sourceList._onclickHandler = sourceList.onclickHandler;
sourceList.onclickHandler = function(e) { this.onclickHandler(e, sourceList);
}.bindAsEventListener(this);
targetList._onclickHandler = targetList.onclickHandler;
@@ -60,6 +60,9 @@
this.targetList = targetList;
this.sourceList = sourceList;
+ this.targetLayoutManager = targetLayoutManager;
+ this.sourceLayoutManager = sourceLayoutManager;
+
this.targetList.shuttleTable.observe("dblclick", function(e)
{this.moveItemByClick(window.event||e, this.targetList,
this.sourceList)}.bindAsEventListener(this));
this.sourceList.shuttleTable.observe("dblclick", function(e)
{this.moveItemByClick(window.event||e, this.sourceList,
this.targetList)}.bindAsEventListener(this));
@@ -130,6 +133,9 @@
this.controlListManager();
this.targetList.controlListManager();
this.saveState();
+
+ this.targetLayoutManager.widthSynchronization();
+ this.sourceLayoutManager.widthSynchronization();
}
},
@@ -162,9 +168,12 @@
this.sourceList.saveState();
},
- moveItemByClick : function(event, sourceComponent, targetComponent) {
+ moveItemByClick : function(event, sourceComponent, targetComponent, layoutManager) {
var item = this.sourceList.getEventTargetRow(event);
this.moveItem(sourceComponent, targetComponent, item);
+
+ this.targetLayoutManager.widthSynchronization();
+ this.sourceLayoutManager.widthSynchronization();
}
}
@@ -174,4 +183,4 @@
copyAll: function (e) { this.moveItems(this.sourceList, this.targetList,
this.sourceList.shuttleItems); return false; },
remove: function (e) { this.moveItems(this.targetList, this.sourceList,
this.targetList.selectedItems); return false; },
removeAll: function (e) { this.moveItems(this.targetList, this.sourceList,
this.targetList.shuttleItems); return false; }
-};
+};
\ No newline at end of file
Modified:
branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
---
branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-12-06
17:27:03 UTC (rev 4564)
+++
branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-12-06
18:05:25 UTC (rev 4565)
@@ -180,9 +180,13 @@
Event.onReady(function() {
var cotrolsIdPrefix = [['up', 'disup'], ['down',
'disdown'], ['last', 'dislast'],
['first','disfirst']];
var listShuttleCotrolsIdPrefix = [['copy', 'discopy'],
['copyAll', 'discopyAll'], ['remove', 'disremove'],
['removeAll','disremoveAll']];
+
+ var sourceLayoutManager = new
LayoutManager('#{clientId}internal_header_tab',
'#{clientId}internal_tab');
+ var targetLayoutManager = new
LayoutManager('#{clientId}tlInternal_header_tab',
'#{clientId}tlInternal_tab');
+
var listShuttle = new Richfaces.ListShuttle(new
Richfaces.ListShuttle.Target('#{clientId}', '#{clientId}tlInternal_tab',
'#{clientId}tlInternal_header_tab', '#{clientId}tlFocusKeeper',
cotrolsIdPrefix, '#{clientId}sortLabel', #{this:getAsEventHandler(context,
component, "onorderchanged")}),
new Richfaces.ListShuttle.Source('#{clientId}',
'#{clientId}internal_tab', '#{clientId}internal_header_tab',
'#{clientId}focusKeeper'),
- "#{clientId}", listShuttleCotrolsIdPrefix,
"#{switchByClick}");
+ "#{clientId}", listShuttleCotrolsIdPrefix,
"#{switchByClick}", sourceLayoutManager, targetLayoutManager);
var sourceLayoutManager = new
LayoutManager('#{clientId}internal_header_tab',
'#{clientId}internal_tab');
var targetLayoutManager = new
LayoutManager('#{clientId}tlInternal_header_tab',
'#{clientId}tlInternal_tab');
sourceLayoutManager.widthSynchronization();