Author: abelevich
Date: 2011-01-27 04:06:26 -0500 (Thu, 27 Jan 2011)
New Revision: 21255
Modified:
trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
Log:
RF-9745 rich:componentControl - when @operation=null, JS exception is thrown
Modified:
trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
===================================================================
---
trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2011-01-27
00:14:48 UTC (rev 21254)
+++
trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2011-01-27
09:06:26 UTC (rev 21255)
@@ -85,13 +85,16 @@
FacesContext facesContext = behaviorContext.getFacesContext();
ComponentControlBehavior controlBehavior = (ComponentControlBehavior) behavior;
+ String apiFunctionName = controlBehavior.getOperation();
+ // Fix
https://issues.jboss.org/browse/RF-9745
+ if (apiFunctionName == null || apiFunctionName.trim().length() == 0) {
+ return "";
+ }
JSFunctionDefinition callback = new JSFunctionDefinition();
callback.addParameter(new JSReference(REF_EVENT));
callback.addParameter(new JSReference(REF_COMPONENT));
- String apiFunctionName = controlBehavior.getOperation();
-
// create callback function
StringBuffer script = new StringBuffer();
script.append(REF_COMPONENT).append("['").append(apiFunctionName).append("'].").append("apply").append("(");