myfaces-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=925315&view=rev
Log:
TOBAGO-134: z-index calculation needed
 - managing z-index in request map, also in the ajax case.

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.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/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.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/MessagesRenderer.java?rev=925315&r1=925314&r2=925315&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java
Fri Mar 19 16:42:02 2010
@@ -25,16 +25,7 @@ package org.apache.myfaces.tobago.render
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.TobagoConstants;
-import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UIBox;
-import org.apache.myfaces.tobago.component.UIButtonCommand;
-import org.apache.myfaces.tobago.component.UICell;
-import org.apache.myfaces.tobago.component.UICommand;
-import org.apache.myfaces.tobago.component.UIGridLayout;
-import org.apache.myfaces.tobago.component.UIMessages;
-import org.apache.myfaces.tobago.component.UIPage;
-import org.apache.myfaces.tobago.component.UIPanel;
-import org.apache.myfaces.tobago.component.UIPopup;
+import org.apache.myfaces.tobago.component.*;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.renderkit.MessageRendererBase;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -103,7 +94,6 @@ public class MessagesRenderer extends Me
     String id = messages.getId() != null ? messages.getId() + "popup" : facesContext.getViewRoot().createUniqueId();
     final UIPopup popup = (UIPopup)
         ComponentUtil.createComponent(facesContext, UIPopup.COMPONENT_TYPE, TobagoConstants.RENDERER_TYPE_POPUP,
id);
-    popup.getAttributes().put(TobagoConstants.ATTR_ZINDEX, 10);
 
     UIPage page = ComponentUtil.findPage(facesContext, messages);
 

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=925315&r1=925314&r2=925315&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:42:02 2010
@@ -24,12 +24,12 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
+import org.apache.myfaces.tobago.TobagoConstants;
 import org.apache.myfaces.tobago.ajax.api.AjaxRenderer;
 import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
 import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UIPopup;
 import org.apache.myfaces.tobago.component.UIPage;
+import org.apache.myfaces.tobago.component.UIPopup;
 import org.apache.myfaces.tobago.context.ClientProperties;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
@@ -39,12 +39,13 @@ import org.apache.myfaces.tobago.renderk
 import org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil;
 import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import org.apache.myfaces.tobago.TobagoConstants;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
 
+import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
+
 public class PopupRenderer extends LayoutableRendererBase implements AjaxRenderer {
 
   private static final Log LOG = LogFactory.getLog(PopupRenderer.class);
@@ -69,9 +70,11 @@ public class PopupRenderer extends Layou
     final String contentDivId = clientId + CONTENT_ID_POSTFIX;
     //final String left = component.getLeft();
     //final String top = component.getTop();
-    Integer zIndex = (Integer) component.getAttributes().get(TobagoConstants.ATTR_ZINDEX);
+    Integer zIndex = (Integer) facesContext.getExternalContext().getRequestMap().get(TobagoConstants.ATTR_ZINDEX);
     if (zIndex == null) {
       zIndex = 0;
+    } else {
+      zIndex += 10;
     }
     facesContext.getExternalContext().getRequestMap().put(TobagoConstants.ATTR_ZINDEX, zIndex);
     final StringBuilder contentStyle = new StringBuilder();
@@ -85,9 +88,6 @@ public class PopupRenderer extends Layou
       contentStyle.append(component.getHeight());
       contentStyle.append("; ");
     }
-    contentStyle.append("z-index: ");
-    contentStyle.append(zIndex + 3);
-    contentStyle.append("; ");
     //contentStyle.append("left: ");
     //contentStyle.append(left);
     //contentStyle.append("; ");
@@ -112,21 +112,23 @@ public class PopupRenderer extends Layou
       writer.startElement(HtmlConstants.IFRAME, component);
       writer.writeIdAttribute(clientId + SUBCOMPONENT_SEP + HtmlConstants.IFRAME);
       writer.writeClassAttribute("tobago-popup-iframe tobago-popup-none");
-      writer.writeStyleAttribute("z-index: " + (zIndex + 2) + ";");      
       UIPage page = ComponentUtil.findPage(facesContext);
-      final StringBuilder frameSize = new StringBuilder();
+      final StringBuilder iFrameStyle = new StringBuilder();
+      iFrameStyle.append("z-index: ");
+      iFrameStyle.append(zIndex + 2);
+      iFrameStyle.append("; ");
       if (component.isModal()) {
         // full client area
-        frameSize.append("width: ");
-        frameSize.append(page.getWidth());
-        frameSize.append("; ");
-        frameSize.append("height: ");
-        frameSize.append(page.getHeight());
-        frameSize.append("; ");
+        iFrameStyle.append("width: ");
+        iFrameStyle.append(page.getWidth());
+        iFrameStyle.append("; ");
+        iFrameStyle.append("height: ");
+        iFrameStyle.append(page.getHeight());
+        iFrameStyle.append("; ");
       } else {
-        frameSize.append(contentStyle); // size of the popup
+        iFrameStyle.append(contentStyle); // size of the popup
       }
-      writer.writeAttribute(HtmlAttributes.STYLE, frameSize.toString(), false);
+      writer.writeAttribute(HtmlAttributes.STYLE, iFrameStyle.toString(), false);
       writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtil.getBlankPage(facesContext),
false);
       writer.writeAttribute(HtmlAttributes.FRAMEBORDER, "0", false);
       writer.endElement(HtmlConstants.IFRAME);
@@ -141,7 +143,12 @@ public class PopupRenderer extends Layou
     }
     writer.writeClassAttribute(styleClasses);
 
+    contentStyle.append("z-index: ");
+    contentStyle.append(zIndex + 3);
+    contentStyle.append("; ");
     writer.writeAttribute(HtmlAttributes.STYLE, contentStyle.toString(), false);
+
+
   }
 
   public void encodeEnd(FacesContext facesContext,
@@ -165,4 +172,3 @@ public class PopupRenderer extends Layou
     facesContext.responseComplete();
   }
 }
-



Mime
View raw message