ICEfaces
  1. ICEfaces
  2. ICE-8314

ace:menuItem - Clicking on menuItem resets browser scroll positon in IE7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.0.0.GA, 3.1.0.BETA2
    • Fix Version/s: 3.1, EE-3.0.0.GA_P01
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 3.1.0 BETA2 062812, IE9 Compat Mode, IE8 Compat Mode, IE7 Standards
    • Assignee Priority:
      P3

      Description

      When clicking on a menuItem in IE and the browser is scrolled down, it will reset/move the browser scroll to the top of the page.

      This only occurs when running IE with the IE7 Standards mode. It also only occurs when the ace:ajax render attribute is set to @all or @form. If set to @this or a specific component this does not occur. This also only seems to affect the menuBar/menuItem components. Using the same code for the ace:pushButton does not cause the issue.

      Other observations:
       - When running in IE9 Compat/IE7 Standars, the following warning is displayed in the console: SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
       - If a full refresh is done after the page is loaded this issue is no longer seen.

        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000MJB0O]
        Hide
        Arran Mccullough added a comment -

        Attached test case that shows the issue.

        Steps:

        • Load welcomeICEfaces.jsf in an IE browser.
        • Scroll the browser down the page.
        • Click on "Menu One" menuItem. Issue does not happen now.
        • Click on "Menu One" menuItem again, browser scroll position is now sent to the top of the page.
        Show
        Arran Mccullough added a comment - Attached test case that shows the issue. Steps: Load welcomeICEfaces.jsf in an IE browser. Scroll the browser down the page. Click on "Menu One" menuItem. Issue does not happen now. Click on "Menu One" menuItem again, browser scroll position is now sent to the top of the page.
        Arran Mccullough made changes -
        Attachment Case11418Example.war [ 14653 ]
        Attachment Case11418Example.zip [ 14654 ]
        Arran Mccullough made changes -
        Assignee Ken Fyten [ ken.fyten ]
        Ken Fyten made changes -
        Fix Version/s 3.1 [ 10312 ]
        Assignee Priority P1
        Assignee Ken Fyten [ ken.fyten ] yip.ng [ yip.ng ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #29813 Wed Jul 04 17:00:40 MDT 2012 yip.ng ICE-8314: ace:menuItem - Clicking on menuItem resets browser scroll position in IE7.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/menu/BaseMenuRenderer.java
        Hide
        yip.ng added a comment - - edited

        Browser scrolling is caused by the dummy href attribute: href="#". See screenshot-01.png. We have made this same mistake many times before in 1.8 in both components and showcase. This will cause some browsers to reload page or reposition to top of page. Should use href="javascript:void 0;" See "JavaScript: The Definitive Guide", by David Flanagan, 6th Ed., section 13.2.5. But even this a long outdated hack. As the author suggests, "The link above would be better expressed as an onclick handler on a <button> element." Either that or we should avoid the onclick attribute altogether and use pure jQuery JS. Either way it would require fundamental changes to the component.

        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\menu\BaseMenuRenderer.java
        Completed: At revision: 29813

        SEC7115 is triggered by the IE9 Tracking Protection mechanism. It is just a harmless warning seen only in developer tools console. Google it for all the tedious details. Leave it unless we want to use the lowest common denominator for the link and visited states CSS and spend the time to ferret out all the possible scenarios that the link and visited states might change.

        Show
        yip.ng added a comment - - edited Browser scrolling is caused by the dummy href attribute: href="#". See screenshot-01.png. We have made this same mistake many times before in 1.8 in both components and showcase. This will cause some browsers to reload page or reposition to top of page. Should use href="javascript:void 0;" See "JavaScript: The Definitive Guide", by David Flanagan, 6th Ed., section 13.2.5. But even this a long outdated hack. As the author suggests, "The link above would be better expressed as an onclick handler on a <button> element." Either that or we should avoid the onclick attribute altogether and use pure jQuery JS. Either way it would require fundamental changes to the component. Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\menu\BaseMenuRenderer.java Completed: At revision: 29813 SEC7115 is triggered by the IE9 Tracking Protection mechanism. It is just a harmless warning seen only in developer tools console. Google it for all the tedious details. Leave it unless we want to use the lowest common denominator for the link and visited states CSS and spend the time to ferret out all the possible scenarios that the link and visited states might change.
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        yip.ng made changes -
        Attachment screenshot-01.png [ 14666 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #29849 Fri Jul 06 16:11:48 MDT 2012 yip.ng ICE-8314: ace:menuItem - Clicking on menuItem resets browser scroll position in IE7.
        Files Changed
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/ace/component/src/org/icefaces/ace/component/menu/BaseMenuRenderer.java
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Priority P1 P3
        Ken Fyten made changes -
        Fix Version/s EE-3.0.0.GA_P01 [ 10327 ]
        Hide
        yip.ng added a comment -

        Done.

        Modified: C:\svn\ossrepo\icefaces3\branches\icefaces-3.0.x-maintenance\icefaces\ace\component\src\org\icefaces\ace\component\menu\BaseMenuRenderer.java
        Completed: At revision: 29849

        Show
        yip.ng added a comment - Done. Modified: C:\svn\ossrepo\icefaces3\branches\icefaces-3.0.x-maintenance\icefaces\ace\component\src\org\icefaces\ace\component\menu\BaseMenuRenderer.java Completed: At revision: 29849
        yip.ng made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: