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 [EMAIL PROTECTED]
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()