You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/05/03 14:53:08 UTC

svn commit: r534832 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java

Author: bommel
Date: Thu May  3 05:53:07 2007
New Revision: 534832

URL: http://svn.apache.org/viewvc?view=rev&rev=534832
Log:
(TOBAGO-379) Caching UIPage in ComponentUtil.findPage in the RequestMap

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?view=diff&rev=534832&r1=534831&r2=534832
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Thu May  3 05:53:07 2007
@@ -53,7 +53,6 @@
 import org.apache.myfaces.tobago.el.ConstantMethodBinding;
 import org.apache.myfaces.tobago.event.SheetStateChangeEvent;
 import org.apache.myfaces.tobago.event.PopupActionListener;
-import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
 import org.apache.myfaces.tobago.util.RangeParser;
 
@@ -123,7 +122,15 @@
     }
     return false;
   }
-
+  public static UIPage findPage(FacesContext context, UIComponent component) {
+    UIPage page = (UIPage) context.getExternalContext().getRequestMap().get(UIPage.COMPONENT_TYPE);
+    if (page == null) {
+      page = findPage(component);
+    } else {
+      context.getExternalContext().getRequestMap().put(UIPage.COMPONENT_TYPE, page);
+    }
+    return page;
+  }
   public static UIPage findPage(UIComponent component) {
     while (component != null) {
       if (component instanceof UIPage) {