myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r925318 - in /myfaces/tobago/branches/tobago-1.0.x: core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
Date Fri, 19 Mar 2010 16:50:16 GMT
Author: lofwyr
Date: Fri Mar 19 16:50:16 2010
New Revision: 925318

URL: http://svn.apache.org/viewvc?rev=925318&view=rev
Log:
TOBAGO-532: Popup Z-Index-Problem with DatePicker and InputSuggest in IE
 - adding a div in non AJAX case, so that the structure is the same like in AJAX case.

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java?rev=925318&r1=925317&r2=925318&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
Fri Mar 19 16:50:16 2010
@@ -27,10 +27,10 @@ import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseId;
 import javax.faces.render.Renderer;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.StringTokenizer;
-import java.util.HashMap;
 
 public class AjaxUtils {
 
@@ -38,6 +38,10 @@ public class AjaxUtils {
 
   public static final String AJAX_COMPONENTS = AjaxUtils.class.getName() + ".AJAX_COMPONENTS";
 
+  public static boolean isAjaxRequest(FacesContext facesContext) {
+    return facesContext.getExternalContext().getRequestMap().containsKey(AJAX_COMPONENTS);
+  }
+
   public static void checkParamValidity(FacesContext facesContext, UIComponent uiComponent,
Class compClass) {
     if (facesContext == null) {
       throw new NullPointerException("facesContext may not be null");
@@ -54,7 +58,6 @@ public class AjaxUtils {
     }
   }
 
-
   public static void encodeAjaxComponent(FacesContext facesContext, UIComponent component)
throws IOException {
     if (facesContext == null) {
       throw new NullPointerException("facesContext");
@@ -68,7 +71,6 @@ public class AjaxUtils {
     }
   }
 
-
   public static void processAjax(FacesContext facesContext, UIComponent component)
       throws IOException {
     if (component instanceof AjaxComponent) {
@@ -162,15 +164,21 @@ public class AjaxUtils {
   }
 
   public static void ensureDecoded(FacesContext facesContext, UIComponent component) {
+    if (component == null) {
+      LOG.warn("Ignore AjaxComponent: null");
+      return;
+    }
     Map<String, UIComponent> ajaxComponents = getAjaxComponents(facesContext);
     if (ajaxComponents != null) {
       for (UIComponent uiComponent : ajaxComponents.values()) {
-        UIComponent currentComponent = component;
-        while (currentComponent != null) {
+        // is component or a parent of it in the list?
+        UIComponent parent = component;
+        while (parent != null) {
           if (component == uiComponent) {
+            // nothing to do, because it was already decoded (in the list)
             return;
           }
-          currentComponent = currentComponent.getParent();
+          parent = parent.getParent();
         }
       }
       component.processDecodes(facesContext);

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java?rev=925318&r1=925317&r2=925318&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
Fri Mar 19 16:50:16 2010
@@ -94,6 +94,12 @@ public class PopupRenderer extends Layou
     //contentStyle.append("top: ");
     //contentStyle.append(top);
     //contentStyle.append("; ");
+
+    if (!AjaxUtils.isAjaxRequest(facesContext)) {
+      writer.startElement(HtmlConstants.DIV, component);
+      writer.writeClassAttribute("tobago-popup-parent");
+    }
+
     if (component.isModal()) {
       writer.startElement(HtmlConstants.DIV, component);
       writer.writeIdAttribute(clientId);
@@ -159,6 +165,10 @@ public class PopupRenderer extends Layou
 
     writer.endElement(HtmlConstants.DIV);
 
+    if (!AjaxUtils.isAjaxRequest(facesContext)) {
+      writer.endElement(HtmlConstants.DIV);
+    }
+
     String setupScript = "Tobago.setupPopup('" + clientId + "', '"
         + component.getLeft() + "', '" + component.getTop() + "', " + component.isModal()
+ ");";
     writer.writeJavascript(setupScript);



Mime
View raw message