incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r447238 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
Date Mon, 18 Sep 2006 05:03:59 GMT
Author: matzew
Date: Sun Sep 17 22:03:59 2006
New Revision: 447238

URL: http://svn.apache.org/viewvc?view=rev&rev=447238
Log:
ADFFACES-179. added Arjuna Wijeyekoon's fix for RequestContextImpl to ensure ppr updates with
non-markup comps.

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java?view=diff&rev=447238&r1=447237&r2=447238
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
Sun Sep 17 22:03:59 2006
@@ -434,6 +434,9 @@
     if (afContext != null)
       pContext = afContext.getPartialPageContext();
 
+    // find the nearest ancestor that generates html markup:
+    newTarget = _getNearestPPRTarget(newTarget);
+
     Object savedKey = null;
     // =-=AEW Force the rowkey of a collection back to null so that the clientId
     // will be correct.  Note that in JSF 1.2, this will be unnecessary
@@ -640,6 +643,24 @@
     }
 
     return fContext;
+  }
+
+  /**
+   * Components that do not render any html-markup cannot be
+   * added as PPR targets. This method will walk up the component
+   * tree finding the nearest ancestor that does render markup.
+   * Components that return null for {@link UIComponent#getRendererType}
+   * are treated as generating no markup.
+   * @param component This component, and its ancestors will be searched.
+   * @return the first component that does render html-markup.
+   */
+  private UIComponent _getNearestPPRTarget(UIComponent component)
+  {
+    while(component.getRendererType() == null)
+    {
+      component = component.getParent();
+    }
+    return component;
   }
 
   private UIXCookie _getUIXCookie()



Mime
View raw message