Author: abelevich
Date: 2010-04-27 10:30:54 -0400 (Tue, 27 Apr 2010)
New Revision: 16823
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js
Log:
fix handler, public api invocation
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java
===================================================================
---
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java 2010-04-27
14:30:04 UTC (rev 16822)
+++
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java 2010-04-27
14:30:54 UTC (rev 16823)
@@ -95,22 +95,24 @@
}
private void collectParameters(FaceletContext ctx, FaceletHandler handler,
UIComponent parent) throws IOException {
- ComponentHandler componentHandler = (ComponentHandler) handler;
-
- ComponentConfig componentConfig = componentHandler.getComponentConfig();
- String componentType = componentConfig.getComponentType();
- if(isUIParameter(componentType)) {
-
- FacesContext facesContext = ctx.getFacesContext();
- UIComponent component =
(UIComponent)facesContext.getApplication().createComponent(facesContext, componentType,
null);
- if((component instanceof UIParameter) || (component instanceof
UIHashParameter)) {
- componentHandler.setAttributes(ctx, component);
- getChildren().add(component);
+ if(handler instanceof ComponentHandler) {
+ ComponentHandler componentHandler = (ComponentHandler) handler;
+
+ ComponentConfig componentConfig = componentHandler.getComponentConfig();
+ String componentType = componentConfig.getComponentType();
+ if(isUIParameter(componentType)) {
+
+ FacesContext facesContext = ctx.getFacesContext();
+ UIComponent component =
(UIComponent)facesContext.getApplication().createComponent(facesContext, componentType,
null);
+ if((component instanceof UIParameter) || (component instanceof
UIHashParameter)) {
+ componentHandler.setAttributes(ctx, component);
+ getChildren().add(component);
+ }
+
+ if(component instanceof UIHashParameter) {
+ componentHandler.applyNextHandler(ctx, component);
+ }
}
-
- if(component instanceof UIHashParameter) {
- componentHandler.applyNextHandler(ctx, component);
- }
}
}
Modified:
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js
===================================================================
---
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js 2010-04-27
14:30:04 UTC (rev 16822)
+++
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js 2010-04-27
14:30:54 UTC (rev 16823)
@@ -9,15 +9,19 @@
var target = parameters.target;
var callback = parameters.callback;
+ if(target) {
+ target = document.getElementById(target);
+ }
+
if(target && (callback && typeof callback == 'function'))
{
richfaces.ui.ComponentControl.eachComponent(event, target, callback);
}
},
eachComponent : function(event, target, callback) {
- $(target.replace(/:/g, "\\:")).each(function() {
- if (this.component) {
- callback(event, this.component);
+ $(target).each(function() {
+ if (this.richfaces && this.richfaces.component) {
+ callback(event, this.richfaces.component);
}
});
}