Author: abelevich
Date: 2008-07-31 09:00:53 -0400 (Thu, 31 Jul 2008)
New Revision: 9844
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
https://jira.jboss.org/jira/browse/RF-4012
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-07-31
12:04:58 UTC (rev 9843)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-07-31
13:00:53 UTC (rev 9844)
@@ -70,6 +70,8 @@
public class AjaxViewRoot extends UIViewRoot implements AjaxContainer {
public static final String ROOT_ID = "_viewRoot";
+
+ public static final String JS_NULL = "null";
private Lifecycle lifecycle;
@@ -216,8 +218,10 @@
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
String submittedRegionClientId = ajaxContext
.getSubmittedRegionClientId();
- if (ajaxContext.isAjaxRequest() && submittedRegionClientId != null
- && !submittedRegionClientId.equals(getClientId(context))) {
+ // !submittedRegionClientId.equals(JS_NULL) - fix for myfaces 1.2.4
+ if (ajaxContext.isAjaxRequest() && submittedRegionClientId != null &&
+ !submittedRegionClientId.equals(JS_NULL)
+ && !submittedRegionClientId.equals(getClientId(context))) {
invokeOnComponent(context, submittedRegionClientId, callback);
} else {
// For a root region, call invokeRoot method, then process all
@@ -535,7 +539,7 @@
String submittedRegionClientId = ajaxContext
.getSubmittedRegionClientId();
boolean invoked = false;
- if (submittedRegionClientId != null &&
!submittedRegionClientId.equals(getClientId(context))) {
+ if (submittedRegionClientId != null &&
!submittedRegionClientId.equals(JS_NULL) &&
!submittedRegionClientId.equals(getClientId(context))) {
invoked = invokeOnComponent(context, submittedRegionClientId, new
ContextCallbackWrapper(_ajaxInvoker));
}
// if container not found, use Root for encode.
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2008-07-31
12:04:58 UTC (rev 9843)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2008-07-31
13:00:53 UTC (rev 9844)
@@ -377,7 +377,16 @@
JSFunction ajaxFunction = new JSFunction(functionName);
UIComponent nestingContainer = (UIComponent) findAjaxContainer(
facesContext, uiComponent);
- ajaxFunction.addParameter(nestingContainer.getClientId(facesContext));
+
+
+ String clientId = nestingContainer.getClientId(facesContext);
+ if (clientId != null) {
+ ajaxFunction.addParameter(clientId);
+ } else {
+ // fix for myfaces 1.2.4
+ ajaxFunction.addParameter(JSReference.NULL);
+ }
+
// build form name or ActionUrl for script
UIComponent nestingForm = getNestingForm(uiComponent);
if (null == nestingForm) {