Author: vmolotkov
Date: 2008-04-30 12:03:12 -0400 (Wed, 30 Apr 2008)
New Revision: 8384
Modified:
trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
http://jira.jboss.com/jira/browse/RF-3296
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-04-30
15:57:22 UTC (rev 8383)
+++
trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2008-04-30
16:03:12 UTC (rev 8384)
@@ -52,6 +52,8 @@
this.targetList = targetList;
this.sourceList = sourceList;
+ this.events = events;
+
this.targetLayoutManager = targetList.layoutManager;
this.sourceLayoutManager = sourceList.layoutManager;
@@ -79,7 +81,7 @@
this.initControlList(clientId, controlIds);
for (var e in this.events) {
- if (e) {
+ if (e && this.events[e]) {
this.container.observe("rich:" + e.toString(), this.events[e]);
}
}
Modified: trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-04-30
15:57:22 UTC (rev 8383)
+++ trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-04-30
16:03:12 UTC (rev 8384)
@@ -187,23 +187,43 @@
RichShuttleUtils.execOnLoad(
function(){
new Richfaces.ListShuttle(
- new Richfaces.ListShuttle.Target('#{clientId}',
'#{clientId}tlInternal_tab', '#{clientId}tlInternal_header_tab',
'#{clientId}tlFocusKeeper',
+ new Richfaces.ListShuttle.Target(
+ '#{clientId}',
+ '#{clientId}tlInternal_tab',
+ '#{clientId}tlInternal_header_tab',
+ '#{clientId}tlFocusKeeper',
[['up', 'disup'], ['down', 'disdown'],
['last', 'dislast'], ['first','disfirst']],
- '#{clientId}sortLabel', #{this:getAsEventHandler(context, component,
"onorderchanged")}, Richfaces.ListShuttle.Target.SelectItem,
#{this:getColumnClassesAsJSArray(context, component)},
#{this:getRowClassesAsJSArray(context, component)}),
- new Richfaces.ListShuttle.Source('#{clientId}',
'#{clientId}internal_tab', '#{clientId}internal_header_tab',
'#{clientId}focusKeeper', undefined, Richfaces.ListShuttle.Source.SelectItem,
#{this:getColumnClassesAsJSArray(context, component)},
#{this:getRowClassesAsJSArray(context, component)}),
- "#{clientId}",
- [['copy', 'discopy'], ['copyAll',
'discopyAll'], ['remove', 'disremove'],
['removeAll','disremoveAll']],
- "#{switchByClick}", {
- onlistchanged:#{this:getAsEventHandler(context, component,
"onlistchanged")},
- oncopyallclick:#{this:getAsEventHandler(context, component,
"oncopyallclick")},
- oncopyclick:#{this:getAsEventHandler(context, component,
"oncopyclick")},
- onremoveallclick:#{this:getAsEventHandler(context, component,
"onremoveallclick")},
- onremoveclick:#{this:getAsEventHandler(context, component,
"onremoveclick")}
- });
- },
- RichShuttleUtils.Condition.ElementPresent("#{clientId}"), 100
- );
- //setTimeout(init, 0);
+ '#{clientId}sortLabel',
+ {onorderchanged:#{this:getAsEventHandler(context, component,
"onorderchanged")},
+ ontopclick:#{this:getAsEventHandler(context, component,
"ontopclick")},
+ onbottomclick:#{this:getAsEventHandler(context, component,
"onbottomclick")},
+ onupclick:#{this:getAsEventHandler(context, component,
"onupclick")},
+ ondownclick:#{this:getAsEventHandler(context, component,
"ondownclick")}},
+ Richfaces.ListShuttle.Target.SelectItem,
+ #{this:getColumnClassesAsJSArray(context, component)},
+ #{this:getRowClassesAsJSArray(context, component)}
+ ),
+ new Richfaces.ListShuttle.Source(
+ '#{clientId}',
+ '#{clientId}internal_tab',
+ '#{clientId}internal_header_tab',
+ '#{clientId}focusKeeper',
+ undefined,
+ Richfaces.ListShuttle.Source.SelectItem,
+ #{this:getColumnClassesAsJSArray(context, component)},
+ #{this:getRowClassesAsJSArray(context, component)}),
+ "#{clientId}",
+ [['copy', 'discopy'], ['copyAll',
'discopyAll'], ['remove', 'disremove'],
['removeAll','disremoveAll']],
+ "#{switchByClick}",
+ {onlistchanged:#{this:getAsEventHandler(context, component,
"onlistchanged")},
+ oncopyallclick:#{this:getAsEventHandler(context, component,
"oncopyallclick")},
+ oncopyclick:#{this:getAsEventHandler(context, component,
"oncopyclick")},
+ onremoveallclick:#{this:getAsEventHandler(context, component,
"onremoveallclick")},
+ onremoveclick:#{this:getAsEventHandler(context, component,
"onremoveclick")}
+ }
+ );
+ },
+ RichShuttleUtils.Condition.ElementPresent("#{clientId}"), 100);
</script>
</td>
</tr>