ICEfaces
  1. ICEfaces
  2. ICE-1490

panelPopup doesn't cover the underlying select boxes in IE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6DR#3
    • Fix Version/s: 1.6.3, 1.7RC1, 1.7
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      IE + select element + panelPopup

      Description

      Existing panelPopup does not covers the underlying select boxes in IE

        Activity

        Hide
        Philip Breau added a comment -

        suggested fix (similar as for ie6 fix for calendar popup)

        Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css
        ===================================================================
        — C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css (revision 14250)
        +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css (working copy)
        @@ -114,7 +114,7 @@
        /margin:10px;/
        }

        -.iceSelInpDateIFrameFix {
        +.iceIEIFrameFix

        { z-index: -1; position: absolute; display: block; Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp.css =================================================================== --- C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp.css (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp.css (working copy) @@ -139,7 +139,7 @@ /*margin:10px;*/ }

        -.iceSelInpDateIFrameFix {
        +.iceIEIFrameFix

        { z-index: -1; position: absolute; display: block; @@ -1532,6 +1532,8 @@ background-color: #DDDDDD; padding: 0px; z-index: 1000; + + }

        .icePnlPopHdr

        { Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/royale/royale.css =================================================================== --- C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/royale/royale.css (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/royale/royale.css (working copy) @@ -142,7 +142,7 @@ /*margin:10px;*/ }

        -.iceSelInpDateIFrameFix {
        +.iceIEIFrameFix {
        z-index: -1;
        position: absolute;
        display: block;
        Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java
        ===================================================================
        — C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 14250)
        +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (working copy)
        @@ -48,6 +48,7 @@
        import org.w3c.dom.Element;
        import org.w3c.dom.Node;
        import org.w3c.dom.NodeList;
        +import org.w3c.dom.Text;

        import javax.faces.component.UIComponent;
        import javax.faces.context.FacesContext;
        @@ -102,12 +103,28 @@
        Element rootDiv = domContext.createRootElement(HTML.DIV_ELEM);
        setRootElementId(facesContext, rootDiv, uiComponent);
        rootDiv.setAttribute(HTML.NAME_ATTR, clientId);
        + rootDiv.setAttribute(HTML.STYLE_ELEM,
        + "display:none;position:absolute;overflow:hidden;");
        +
        +
        Element table = domContext.createElement(HTML.TABLE_ELEM);
        table.setAttribute(HTML.CELLPADDING_ATTR, "0");
        table.setAttribute(HTML.CELLSPACING_ATTR, "0");
        table.setAttribute(HTML.WIDTH_ATTR, "100%");
        -
        + table.setAttribute(HTML.STYLE_ATTR, "position:absolute;");
        rootDiv.appendChild(table);
        +
        + String width;
        + String height;
        + String origStyle = panelPopup.getStyle();
        + width = origStyle.substring( origStyle.indexOf("width"), origStyle.indexOf(";", origStyle.indexOf("width"))+1);
        + height = origStyle.substring( origStyle.indexOf("height"), origStyle.indexOf(";", origStyle.indexOf("height"))+1);
        +
        +
        + Text iframe = domContext.createTextNode("<!--[if lte IE"+
        + " 6.5]><iframe class=\"iceIEIFrameFix\" style=\"" + width + height + "\"></iframe><![endif]-->");
        + rootDiv.appendChild(iframe);
        +
        if (modal != null && modal.booleanValue())

        { dndType = null; }

        Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
        ===================================================================
        — C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java (revision 14250)
        +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java (working copy)
        @@ -260,7 +260,7 @@
        table.setAttribute(HTML.SUMMARY_ATTR,"This table contains a Calendar where a date can be selected.");
        calendarDiv.appendChild(table);
        Text iframe = domContext.createTextNode("<!--[if lte IE"+

        • " 6.5]><iframe class=\"iceSelInpDateIFrameFix\"></iframe><![endif]-->");
          + " 6.5]><iframe class=\"iceIEIFrameFix\"></iframe><![endif]-->");
          calendarDiv.appendChild(iframe);
          root.appendChild(calendarDiv);
          // render a hidden field to manage the popup state; visible || hidden
        Show
        Philip Breau added a comment - suggested fix (similar as for ie6 fix for calendar popup) Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css =================================================================== — C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css (working copy) @@ -114,7 +114,7 @@ / margin:10px; / } -.iceSelInpDateIFrameFix { +.iceIEIFrameFix { z-index: -1; position: absolute; display: block; Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp.css =================================================================== --- C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp.css (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/xp/xp.css (working copy) @@ -139,7 +139,7 @@ /*margin:10px;*/ } -.iceSelInpDateIFrameFix { +.iceIEIFrameFix { z-index: -1; position: absolute; display: block; @@ -1532,6 +1532,8 @@ background-color: #DDDDDD; padding: 0px; z-index: 1000; + + } .icePnlPopHdr { Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/royale/royale.css =================================================================== --- C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/royale/royale.css (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/core/src/com/icesoft/faces/resources/css/royale/royale.css (working copy) @@ -142,7 +142,7 @@ /*margin:10px;*/ } -.iceSelInpDateIFrameFix { +.iceIEIFrameFix { z-index: -1; position: absolute; display: block; Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java =================================================================== — C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/panelpopup/PanelPopupRenderer.java (working copy) @@ -48,6 +48,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.Text; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; @@ -102,12 +103,28 @@ Element rootDiv = domContext.createRootElement(HTML.DIV_ELEM); setRootElementId(facesContext, rootDiv, uiComponent); rootDiv.setAttribute(HTML.NAME_ATTR, clientId); + rootDiv.setAttribute(HTML.STYLE_ELEM, + "display:none;position:absolute;overflow:hidden;"); + + Element table = domContext.createElement(HTML.TABLE_ELEM); table.setAttribute(HTML.CELLPADDING_ATTR, "0"); table.setAttribute(HTML.CELLSPACING_ATTR, "0"); table.setAttribute(HTML.WIDTH_ATTR, "100%"); - + table.setAttribute(HTML.STYLE_ATTR, "position:absolute;"); rootDiv.appendChild(table); + + String width; + String height; + String origStyle = panelPopup.getStyle(); + width = origStyle.substring( origStyle.indexOf("width"), origStyle.indexOf(";", origStyle.indexOf("width"))+1); + height = origStyle.substring( origStyle.indexOf("height"), origStyle.indexOf(";", origStyle.indexOf("height"))+1); + + + Text iframe = domContext.createTextNode("<!--[if lte IE"+ + " 6.5]><iframe class=\"iceIEIFrameFix\" style=\"" + width + height + "\"></iframe><! [endif] -->"); + rootDiv.appendChild(iframe); + if (modal != null && modal.booleanValue()) { dndType = null; } Index: C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java =================================================================== — C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java (revision 14250) +++ C:/Documents and Settings/laptop/workspace/ICEfaces head/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java (working copy) @@ -260,7 +260,7 @@ table.setAttribute(HTML.SUMMARY_ATTR,"This table contains a Calendar where a date can be selected."); calendarDiv.appendChild(table); Text iframe = domContext.createTextNode("<!--[if lte IE"+ " 6.5]><iframe class=\"iceSelInpDateIFrameFix\"></iframe><! [endif] -->"); + " 6.5]><iframe class=\"iceIEIFrameFix\"></iframe><! [endif] -->"); calendarDiv.appendChild(iframe); root.appendChild(calendarDiv); // render a hidden field to manage the popup state; visible || hidden
        Hide
        yip.ng added a comment -

        Screenshot showing the problem.

        Show
        yip.ng added a comment - Screenshot showing the problem.
        Hide
        yip.ng added a comment -

        Screenshot testing the fix.

        Show
        yip.ng added a comment - Screenshot testing the fix.
        Hide
        yip.ng added a comment -

        Backported to 1.6.2.

        Show
        yip.ng added a comment - Backported to 1.6.2.
        Hide
        Patrick Corless added a comment -

        It looks like there was a bug introduced with this enhancement.

        Consider:

        String origStyle = panelPopup.getStyle();
        width = origStyle.substring(origStyle.indexOf("width"), origStyle.indexOf(";", origStyle.indexOf("width")) + 1);
        height = origStyle.substring(origStyle.indexOf("height"), origStyle.indexOf(";", origStyle.indexOf("height")) + 1);

        If no style class was used then we get a null pointer and an index out of bounds if height is ignored.

        I think we should rethink the logic for adding the ifram fix for IE.

        Yip mentioned that there might be a way to rework the example so that a user can get away without specifying width or height.

        Show
        Patrick Corless added a comment - It looks like there was a bug introduced with this enhancement. Consider: String origStyle = panelPopup.getStyle(); width = origStyle.substring(origStyle.indexOf("width"), origStyle.indexOf(";", origStyle.indexOf("width")) + 1); height = origStyle.substring(origStyle.indexOf("height"), origStyle.indexOf(";", origStyle.indexOf("height")) + 1); If no style class was used then we get a null pointer and an index out of bounds if height is ignored. I think we should rethink the logic for adding the ifram fix for IE. Yip mentioned that there might be a way to rework the example so that a user can get away without specifying width or height.
        Hide
        Ken Fyten added a comment -

        Looks like the fix for handling the case if the width and height are not specified (specifying a height and width in the default theme style) is causing other problems:
        http://www.icefaces.org/JForum/posts/list/7410.page#31402

        Basically, the height of the panelPopup now has to be specified whereas previously it would autosize to the height of the embedded container. This seems unacceptable in terms of the utility and ease-of-use of the component.

        Ideas on how to resolve the original issue without specifying the height/width for the component?

        Show
        Ken Fyten added a comment - Looks like the fix for handling the case if the width and height are not specified (specifying a height and width in the default theme style) is causing other problems: http://www.icefaces.org/JForum/posts/list/7410.page#31402 Basically, the height of the panelPopup now has to be specified whereas previously it would autosize to the height of the embedded container. This seems unacceptable in terms of the utility and ease-of-use of the component. Ideas on how to resolve the original issue without specifying the height/width for the component?
        Hide
        yip.ng added a comment -

        Tried changing the renderer and also adding some dynamic JavaScript. But it seems the changes work only for the simplest popup. They don't work or even affect the rendering and behavior of the many other types of popups: modal, draggable, resizable, auto center, auto position, tooltip, ... Need to go through their rendering and JavaScript one by one? Also need to make sure changes don't wreck anything back in IE7 and Firefox.

        Show
        yip.ng added a comment - Tried changing the renderer and also adding some dynamic JavaScript. But it seems the changes work only for the simplest popup. They don't work or even affect the rendering and behavior of the many other types of popups: modal, draggable, resizable, auto center, auto position, tooltip, ... Need to go through their rendering and JavaScript one by one? Also need to make sure changes don't wreck anything back in IE7 and Firefox.
        Hide
        yip.ng added a comment -

        Fix redone using mainly dynamic JavaScript (executed only in IE versions below 7). Both width and height can be left unspecified. But in practice, width may still need to be specified, otherwise the popup div could look stretched out too wide. Tried a number of approaches (CSS only, didn't try any JavaScript) to remedy this, but none worked cross browsers and browser versions.

        Show
        yip.ng added a comment - Fix redone using mainly dynamic JavaScript (executed only in IE versions below 7). Both width and height can be left unspecified. But in practice, width may still need to be specified, otherwise the popup div could look stretched out too wide. Tried a number of approaches (CSS only, didn't try any JavaScript) to remedy this, but none worked cross browsers and browser versions.
        Hide
        yip.ng added a comment -

        Need to back out of fix for 1.6 branch too.

        Show
        yip.ng added a comment - Need to back out of fix for 1.6 branch too.
        Hide
        yip.ng added a comment -

        Backed out of suggested fix in 1.6 branch.

        Show
        yip.ng added a comment - Backed out of suggested fix in 1.6 branch.
        Hide
        Ken Fyten added a comment -

        Note that the 1.6 branch no longer contains any changes related to the fix for this issue. The ultimate fix is too extensive in nature to be backported to the 1.6 branch. Anyone wanting the new fix will need to use 1.7.

        Show
        Ken Fyten added a comment - Note that the 1.6 branch no longer contains any changes related to the fix for this issue. The ultimate fix is too extensive in nature to be backported to the 1.6 branch. Anyone wanting the new fix will need to use 1.7.

          People

          • Assignee:
            Unassigned
            Reporter:
            Adnan Durrani
          • Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: