Author: maksimkaszynski
Date: 2007-11-26 13:19:48 -0500 (Mon, 26 Nov 2007)
New Revision: 4269
Modified:
branches/3.1.x/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
Log:
Component control allows invocation of multiple components
Modified:
branches/3.1.x/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
===================================================================
---
branches/3.1.x/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2007-11-26
16:21:42 UTC (rev 4268)
+++
branches/3.1.x/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2007-11-26
18:19:48 UTC (rev 4269)
@@ -6,14 +6,45 @@
Richfaces.componentControl = {};
}
+Richfaces.componentControl.eachComponent = function(forAttr, callback) {
+ jQuery(forAttr)
+ .each(function() {
+ if (this.component) {
+ callback(this.component);
+ }
+ });
+
+};
+
+Richfaces.componentControl.applyDecorations = function (element, forAttr, decorationCode)
{
+ if (decorationCode) {
+ decorationCode(element);
+ }
+
+ Richfaces.componentControl.eachComponent(forAttr, function(component) {
+ if (component.applyDecoration) {
+ component.applyDecoration(element);
+ }
+ });
+
+};
+
Richfaces.componentControl.attachEvent = function(attachTo, aevent, forAttr, operation,
params) {
jQuery(attachTo).bind(Richfaces.effectEventOnOut(aevent), function(cevent) {
- jQuery( forAttr)[0].component[operation](cevent, params);
+ Richfaces.componentControl.eachComponent(forAttr, function(component) {
+ component[operation](cevent, params);
+ });
+ }).each(function() {
+ Richfaces.componentControl.applyDecorations(this, forAttr, function(element) {
+ //TODO: handle component decoration
+ });
});
};
Richfaces.componentControl.performOperation = function( cevent, forAttr, operation,
params) {
- jQuery( forAttr)[0].component[operation](cevent, params);
+ Richfaces.componentControl.eachComponent(forAttr, function(component) {
+ component[operation](cevent, params);
+ });
};
Show replies by date