Author: nbelaevski
Date: 2009-04-30 13:28:10 -0400 (Thu, 30 Apr 2009)
New Revision: 13977
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-6938
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2009-04-30
17:05:16 UTC (rev 13976)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/AjaxFunctionRendererBase.java 2009-04-30
17:28:10 UTC (rev 13977)
@@ -25,6 +25,7 @@
import java.util.Iterator;
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
@@ -51,7 +52,12 @@
}
public String getFunction(FacesContext context, UIAjaxFunction component) {
- StringBuffer script = new StringBuffer(component.getName()).append("=");
+ String functionName = component.getName();
+ if (functionName == null || functionName.length() == 0) {
+ throw new FacesException("Value of 'name' attribute of a4j:jsFunction
component is empty or null!");
+ }
+
+ StringBuffer script = new StringBuffer(functionName).append("=");
JSFunctionDefinition func = new JSFunctionDefinition();
//func.setName(component.getName());
// Create AJAX Submit function.