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 2008/02/08 17:41:08 UTC

svn commit: r619933 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/ core/src/main/java/org/apache/myfaces/tobago/component/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ the...

Author: bommel
Date: Fri Feb  8 08:41:01 2008
New Revision: 619933

URL: http://svn.apache.org/viewvc?rev=619933&view=rev
Log:
(TOBAGO-133) DatePicker popup renders on wrong z-index
partial solution

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java?rev=619933&r1=619932&r2=619933&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java Fri Feb  8 08:41:01 2008
@@ -187,7 +187,8 @@
   public static final String ATTR_APPLICATION_ICON = "applicationIcon";
   public static final String ATTR_VALIDATOR = "validator";
   public static final String ATTR_TAB_INDEX = "tabIndex";
-
+  public static final String ATTR_ZINDEX = "zIndex";
+  
   public static final String FACET_ACTION = "action";
   public static final String FACET_CONFIRMATION = "confirmation";
   public static final String FACET_LABEL = "label";

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java?rev=619933&r1=619932&r2=619933&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIDatePicker.java Fri Feb  8 08:41:01 2008
@@ -37,6 +37,7 @@
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.event.DatePickerController;
 import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
+import org.apache.myfaces.tobago.TobagoConstants;
 
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIGraphic;
@@ -151,6 +152,8 @@
     } else {
       popup.setId(facesContext.getViewRoot().createUniqueId());
     }
+    popup.getAttributes().put(TobagoConstants.ATTR_ZINDEX, 10);
+      
     link.getFacets().put(FACET_PICKER_POPUP, popup);
 
     popup.setRendered(false);

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java?rev=619933&r1=619932&r2=619933&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java Fri Feb  8 08:41:01 2008
@@ -39,6 +39,7 @@
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
 import org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.apache.myfaces.tobago.TobagoConstants;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -69,6 +70,10 @@
     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);
+    if (zIndex == null) {
+      zIndex = 0;
+    }
 
     final StringBuilder contentStyle = new StringBuilder();
     if (component.getWidth() != null) {
@@ -81,6 +86,9 @@
       contentStyle.append(component.getHeight());
       contentStyle.append("; ");
     }
+    contentStyle.append("z-index: ");
+    contentStyle.append(zIndex + 3);
+    contentStyle.append("; ");
     //contentStyle.append("left: ");
     //contentStyle.append(left);
     //contentStyle.append("; ");
@@ -90,6 +98,7 @@
     if (component.isModal()) {
       writer.startElement(HtmlConstants.DIV, component);
       writer.writeIdAttribute(clientId);
+      writer.writeStyleAttribute("z-index: " + (zIndex + 1) + ";");
       writer.writeClassAttribute();
       writer.writeAttribute(HtmlAttributes.ONCLICK, "Tobago.popupBlink('" + clientId + "')", null);
       if (ClientProperties.getInstance(facesContext).getUserAgent().isMsie()) {
@@ -104,6 +113,7 @@
       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();
       if (component.isModal()) {

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=619933&r1=619932&r2=619933&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Fri Feb  8 08:41:01 2008
@@ -510,7 +510,6 @@
 /* popup-------------------------------------------------------------- */
 
 .tobago-popup-default {
-  z-index: 1;
   cursor: wait;
   width: 100%;
   height: 100%;
@@ -528,7 +527,6 @@
 }
 
 .tobago-popup-iframe {
-  z-index: 2;
   position: absolute;
   width: 100%;
   height: 100%;
@@ -538,7 +536,6 @@
 }
 
 .tobago-popup-content {
-  z-index: 3;
   border-width: 0px;
   background: #bbccdd;
   position: absolute;