ICEfaces
  1. ICEfaces
  2. ICE-5320

Regression: Visible property for commandButton & input text field not working in IE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      IE browser

      Description

      The visible property of the commandButton & inputTextField does not seem to be working in IE. It works fine in FireFox. This is a regression of ICE-3335.

        Activity

        Hide
        Ken Fyten added a comment -

        Please check if latest icefaces/trunk passes this test.

        Show
        Ken Fyten added a comment - Please check if latest icefaces/trunk passes this test.
        Hide
        Mandeep Hayher added a comment - - edited

        Glimmer revision# 21634
        Server: Tomcat6
        The problem still exists on IE8 browser.

        Note: works fine on icefaces trunk.

        Show
        Mandeep Hayher added a comment - - edited Glimmer revision# 21634 Server: Tomcat6 The problem still exists on IE8 browser. Note: works fine on icefaces trunk.
        Hide
        yip.ng added a comment - - edited

        Tracked the property value from the bean on the server side to the browser. Wrote some code to display the AJAX response text.

        The style property is seen to be set correctly in the AJAX response text, yet somehow the DOM update is not done correctly in IE. See video at http://screencast.com/t/ZmRlYzg1N2Ut

        The DOM update JS code in icefaces2 is drastically different now. Can't figure out what caused the regression.

        Show
        yip.ng added a comment - - edited Tracked the property value from the bean on the server side to the browser. Wrote some code to display the AJAX response text. The style property is seen to be set correctly in the AJAX response text, yet somehow the DOM update is not done correctly in IE. See video at http://screencast.com/t/ZmRlYzg1N2Ut The DOM update JS code in icefaces2 is drastically different now. Can't figure out what caused the regression.
        Hide
        Ken Fyten added a comment -

        Seems like a DOM update problem in IE. Perhaps some recent patches will resolve this one too?

        Show
        Ken Fyten added a comment - Seems like a DOM update problem in IE. Perhaps some recent patches will resolve this one too?
        Hide
        Mircea Toma added a comment - - edited

        In JSF2 the JSF bridge is responsible for applying the DOM updates. There is specific code used for updating 'input' elements. To preserve focus the 'input' element attributes are updated instead of having the element replaced entirely. For this to work there is special code for handling certain attributes, 'style' attribute being one of them.
        Here's the code:

        //'style' attribute special case
        var newStyle = source.getAttribute('style');
        var oldStyle = target.getAttribute('style');
        if (newStyle != oldStyle) {
        if (isIE())

        { target.style.setAttribute('cssText', newStyle, 0); }

        else

        { target.setAttribute('style',newStyle); }
        }

        Unfortunately the IE specific code does not work as expected. When source.getAttribute('style') is invoked the DOM element's 'style' property is returned instead of the string value. To fix the issue the code needs to be changed slightly:

        //'style' attribute special case
        if (isIE()) {
        var newStyle = source.style.cssText;
        var oldStyle = target.style.cssText;
        if (newStyle != oldStyle) { target.style.cssText = newStyle; }
        } else {
        var newStyle = source.getAttribute('style');
        var oldStyle = target.getAttribute('style');
        if (newStyle != oldStyle) { target.setAttribute('style',newStyle); }

        }

        Show
        Mircea Toma added a comment - - edited In JSF2 the JSF bridge is responsible for applying the DOM updates. There is specific code used for updating 'input' elements. To preserve focus the 'input' element attributes are updated instead of having the element replaced entirely. For this to work there is special code for handling certain attributes, 'style' attribute being one of them. Here's the code: //'style' attribute special case var newStyle = source.getAttribute('style'); var oldStyle = target.getAttribute('style'); if (newStyle != oldStyle) { if (isIE()) { target.style.setAttribute('cssText', newStyle, 0); } else { target.setAttribute('style',newStyle); } } Unfortunately the IE specific code does not work as expected. When source.getAttribute('style') is invoked the DOM element's 'style' property is returned instead of the string value. To fix the issue the code needs to be changed slightly: //'style' attribute special case if (isIE()) { var newStyle = source.style.cssText; var oldStyle = target.style.cssText; if (newStyle != oldStyle) { target.style.cssText = newStyle; } } else { var newStyle = source.getAttribute('style'); var oldStyle = target.getAttribute('style'); if (newStyle != oldStyle) { target.setAttribute('style',newStyle); } }
        Hide
        Mircea Toma added a comment -

        Attached patch for jsf.js.

        Show
        Mircea Toma added a comment - Attached patch for jsf.js.
        Hide
        Mircea Toma added a comment -

        Create issue in Mojarra's bug tracking system: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1813

        Show
        Mircea Toma added a comment - Create issue in Mojarra's bug tracking system: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1813
        Hide
        Ken Fyten added a comment -

        A follow-up JIRA for this issue for a solution available in ICEfaces EE is: ICE-6480

        Show
        Ken Fyten added a comment - A follow-up JIRA for this issue for a solution available in ICEfaces EE is: ICE-6480

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mandeep Hayher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: