ICEfaces
  1. ICEfaces
  2. ICE-3064

using ice:menuItems nested inside dataTable breaks component

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      any

      Description

      Using the ice:menuItems component nested inside a dataTable breaks the component in that only the last table row contains a static list of menu items.
      see attached source files for further information
      1. ContactData.java
        1.0 kB
        Michael Thiem
      2. CustomMenuModel.java
        2 kB
        Michael Thiem
      3. MenuHandler.java
        2 kB
        Michael Thiem
      4. newmenu2.jspx
        3 kB
        Michael Thiem
      1. js_error.jpg
        111 kB
      2. screenshot.jpg
        197 kB
      3. screenshot-1.jpg
        117 kB
      4. screenshot-2.jpg
        120 kB
      5. screenshot-3.jpg
        164 kB
      6. screenshot-4.jpg
        75 kB
      7. screenshot-5.jpg
        183 kB
      8. screenshot-6.jpg
        148 kB
      9. screenshot-7.jpg
        78 kB
      10. screenshot-8.jpg
        81 kB

        Activity

        Michael Thiem created issue -
        Hide
        Michael Thiem added a comment -

        backing bean code

        Show
        Michael Thiem added a comment - backing bean code
        Michael Thiem made changes -
        Field Original Value New Value
        Attachment MenuHandler.java [ 10968 ]
        Hide
        Michael Thiem added a comment -

        singleton menu model data

        Show
        Michael Thiem added a comment - singleton menu model data
        Michael Thiem made changes -
        Attachment CustomMenuModel.java [ 10969 ]
        Hide
        Michael Thiem added a comment -

        table model data

        Show
        Michael Thiem added a comment - table model data
        Michael Thiem made changes -
        Attachment ContactData.java [ 10970 ]
        Hide
        Michael Thiem added a comment -

        sample jspx file

        Show
        Michael Thiem added a comment - sample jspx file
        Michael Thiem made changes -
        Attachment newmenu2.jspx [ 10971 ]
        Michael Thiem made changes -
        Ken Fyten made changes -
        Fix Version/s 1.7.1 [ 10122 ]
        Assignee Priority P2
        Assignee Mark Collette [ mark.collette ]
        Hide
        Michael Thiem added a comment -

        tested on tomcat 5.5

        Show
        Michael Thiem added a comment - tested on tomcat 5.5
        Michael Thiem made changes -
        Attachment Test_MenuItems.war [ 11014 ]
        Hide
        Michael Thiem added a comment -

        sources

        Show
        Michael Thiem added a comment - sources
        Michael Thiem made changes -
        Attachment Test_MenuItems.zip [ 11015 ]
        Ken Fyten made changes -
        Assignee Mark Collette [ mark.collette ] Yip Ng [ yip.ng ]
        Hide
        yip.ng added a comment -

        Can't get the sample app. to run. Keeps saying:

        May 30, 2008 11:18:04 AM org.apache.catalina.core.StandardContext start
        SEVERE: Error listenerStart
        May 30, 2008 11:18:04 AM org.apache.catalina.core.StandardContext start
        SEVERE: Context [/ICE-3064] startup failed due to previous errors

        Show
        yip.ng added a comment - Can't get the sample app. to run. Keeps saying: May 30, 2008 11:18:04 AM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart May 30, 2008 11:18:04 AM org.apache.catalina.core.StandardContext start SEVERE: Context [/ICE-3064] startup failed due to previous errors
        yip.ng made changes -
        Attachment screenshot-1.jpg [ 11027 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16774 Fri May 30 16:57:25 MDT 2008 yip.ng ICE-3064
        Cleared menu item client id values so a unique client id will be regenerated when menu items are in a UIData component.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/menubar/MenuItemRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16775 Fri May 30 16:58:47 MDT 2008 yip.ng ICE-3064
        Cleared menu item client id values so a unique client id will be regenerated when menu items are in a UIData component.
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/menubar/MenuItemRenderer.java
        yip.ng made changes -
        Attachment screenshot-2.jpg [ 11031 ]
        Hide
        yip.ng added a comment -

        The problem was caused by using the same menu items component for all rows of the table. This produced menu items with same id's in different rows, which messed up the rendering.

        Suggested fix from Mark:

        Clear out cached clientId value so that a unique clientId will be generated when menu items are in a UIData component.

        Show
        yip.ng added a comment - The problem was caused by using the same menu items component for all rows of the table. This produced menu items with same id's in different rows, which messed up the rendering. Suggested fix from Mark: Clear out cached clientId value so that a unique clientId will be generated when menu items are in a UIData component.
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Comment [ From Philip, I tested the attached demo app and it is still not working correctly. The menubar is shown in every table row now, but as soon as a menuitem is selected a javascript error occurs and the application doesn't respond anymore. ]
        Hide
        Ken Fyten added a comment -

        From Michael:
        I tested the attached demo app and it is still not working correctly. The menubar is shown in every table row now, but as soon as a menuitem is selected a javascript error occurs and the application doesn't respond anymore.

        Show
        Ken Fyten added a comment - From Michael: I tested the attached demo app and it is still not working correctly. The menubar is shown in every table row now, but as soon as a menuitem is selected a javascript error occurs and the application doesn't respond anymore.
        Hide
        Ken Fyten added a comment -

        Here's a screenshot showing the new problem.

        Show
        Ken Fyten added a comment - Here's a screenshot showing the new problem.
        Ken Fyten made changes -
        Attachment screenshot.jpg [ 11038 ]
        Hide
        yip.ng added a comment -

        Couldn't reproduce error. Worked OK when run in Intellij and Tomcat 6 with demo app code integrated in component showcase. No JavaScript error on client side, and event handler was called properly on server side. See attached screenshot-3.

        (Still can't get the sample app. to run standalone. always gets this error:
        SEVERE: Error listenerStart)

        Show
        yip.ng added a comment - Couldn't reproduce error. Worked OK when run in Intellij and Tomcat 6 with demo app code integrated in component showcase. No JavaScript error on client side, and event handler was called properly on server side. See attached screenshot-3. (Still can't get the sample app. to run standalone. always gets this error: SEVERE: Error listenerStart)
        yip.ng made changes -
        Attachment screenshot-3.jpg [ 11040 ]
        Hide
        yip.ng added a comment -

        Finally got it to run standalone. But still no error. The result was exactly the same as running embedded in component showcase.

        Show
        yip.ng added a comment - Finally got it to run standalone. But still no error. The result was exactly the same as running embedded in component showcase.
        yip.ng made changes -
        Attachment screenshot-4.jpg [ 11041 ]
        Hide
        yip.ng added a comment -

        Run without Intellij by manually deploying to Tomcat 6. Still no error. See screenshot-5.

        Show
        yip.ng added a comment - Run without Intellij by manually deploying to Tomcat 6. Still no error. See screenshot-5.
        yip.ng made changes -
        Attachment screenshot-5.jpg [ 11042 ]
        Hide
        yip.ng added a comment -

        Working war file for Tomcat 6.

        Show
        yip.ng added a comment - Working war file for Tomcat 6.
        yip.ng made changes -
        Attachment ICE-3064.war [ 11043 ]
        Hide
        Michael Thiem added a comment -

        I see the same behaviour in your test application. Cleared all temporary browser data to be sure I'm not working with any cached code. The issue happens in Firefox and IE. Looking at the Javascript code shows that the following method causes this problem:

        ice-extras.js

        hideMenuWithId: function(menu) {
        if (menu)

        { menu = $(menu); if (menu.iframe) menu.iframe.hide(); // ICE-2066, ICE-2912 menu.style.display='none'; Ice.Menu.removeFromOpenMenus(menu); }

        return;
        }

        The expression menu = $(menu); assigns NULL to menu which causes an exception and the page to be unresponsible until a browser refresh is done.

        Show
        Michael Thiem added a comment - I see the same behaviour in your test application. Cleared all temporary browser data to be sure I'm not working with any cached code. The issue happens in Firefox and IE. Looking at the Javascript code shows that the following method causes this problem: ice-extras.js hideMenuWithId: function(menu) { if (menu) { menu = $(menu); if (menu.iframe) menu.iframe.hide(); // ICE-2066, ICE-2912 menu.style.display='none'; Ice.Menu.removeFromOpenMenus(menu); } return; } The expression menu = $(menu); assigns NULL to menu which causes an exception and the page to be unresponsible until a browser refresh is done.
        Hide
        yip.ng added a comment -

        Stepped through the JavaScript many, many times. The "menu" variable did have a valid value every time and the indicator at the bottom right corner of the browser remained green. Not once did I encounter any error. See screenshot-6.

        Show
        yip.ng added a comment - Stepped through the JavaScript many, many times. The "menu" variable did have a valid value every time and the indicator at the bottom right corner of the browser remained green. Not once did I encounter any error. See screenshot-6.
        yip.ng made changes -
        Attachment screenshot-6.jpg [ 11053 ]
        Hide
        yip.ng added a comment -

        Attached modified source zip file with build script added. To build the war file, modify the import file location (for build-common.xml) in build.xml and execute the default target (tomcat6.0).

        Show
        yip.ng added a comment - Attached modified source zip file with build script added. To build the war file, modify the import file location (for build-common.xml) in build.xml and execute the default target (tomcat6.0).
        yip.ng made changes -
        Attachment ICE-3064.zip [ 11057 ]
        yip.ng made changes -
        Assignee Yip Ng [ yip.ng ] Ken Fyten [ ken.fyten ]
        Hide
        Ken Fyten added a comment -

        Sam, please take the latest source that Yip attached to this case and try to reproduce the JS errors that Michael is still reporting.

        Show
        Ken Fyten added a comment - Sam, please take the latest source that Yip attached to this case and try to reproduce the JS errors that Michael is still reporting.
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Sam Xiao [ sam.xiao ]
        yip.ng made changes -
        Assignee Sam Xiao [ sam.xiao ] Yip Ng [ yip.ng ]
        Hide
        yip.ng added a comment -

        Thanks to Sam's testing efforts, I am finally able to consistently reproduce the error. At first glance, the cause looks like a hidden bug in the menu handling JavaScript that gets exposed when certain sequences of mouse hover and click events occur on overlapping menu div areas. (I tended to click on the edges of menu divs, which don't overlap. Maybe that's why the error never showed up on my machine.)

        Show
        yip.ng added a comment - Thanks to Sam's testing efforts, I am finally able to consistently reproduce the error. At first glance, the cause looks like a hidden bug in the menu handling JavaScript that gets exposed when certain sequences of mouse hover and click events occur on overlapping menu div areas. (I tended to click on the edges of menu divs, which don't overlap. Maybe that's why the error never showed up on my machine.)
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16847 Tue Jun 10 15:23:33 MDT 2008 yip.ng ICE-3064
        Fixed hidden JavaScript bug exposed by fix for ICE-3064.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/component/menu.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16848 Tue Jun 10 15:25:09 MDT 2008 yip.ng ICE-3064
        Fixed hidden JavaScript bug exposed by fix for ICE-3064.
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/bridge/component/menu.js
        yip.ng made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        yip.ng added a comment -

        From Michael: (See screenshot-7)

        When you hover over a menuItem you can see the list of submenus. If you look at their contents you will see that the first menu item is empty and the second contains the label of menuItem one and two.

        Show
        yip.ng added a comment - From Michael: (See screenshot-7) When you hover over a menuItem you can see the list of submenus. If you look at their contents you will see that the first menu item is empty and the second contains the label of menuItem one and two.
        yip.ng made changes -
        Attachment screenshot-7.jpg [ 11066 ]
        Hide
        yip.ng added a comment -

        This is yet another hidden bug (CSS?) exposed by the fix for ICE-3076.

        Show
        yip.ng added a comment - This is yet another hidden bug (CSS?) exposed by the fix for ICE-3076 .
        yip.ng made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16892 Fri Jun 13 14:11:20 MDT 2008 yip.ng ICE-3064
        Fixed menu item CSS bug exposed by fix for ICE-3076.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp.css
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/royale/royale.css
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/rime/rime.css
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/rime/rime-portlet.css
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16894 Fri Jun 13 14:14:05 MDT 2008 yip.ng ICE-3064
        Fixed menu item CSS bug exposed by fix for ICE-3076.
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/resources/css/rime/rime.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/resources/css/rime/rime-portlet.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/resources/css/royale/royale.css
        Hide
        yip.ng added a comment -

        Fixed. See screenshot-8.

        Show
        yip.ng added a comment - Fixed. See screenshot-8.
        yip.ng made changes -
        Attachment screenshot-8.jpg [ 11067 ]
        yip.ng made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        yip.ng added a comment -

        From Michael:

        I tested it with the latest branch and besides a javascript error I get, everything seems to work fine now. The javascript error doesn't seem to have any impact on the functionality and occurs sporadically after some time of unresponsiveness of the client. The firebug error log is attached. Also, there's one more thing which I'm not sure of if it should be regarded as a bug or not. You can simply reproduce it by following the steps below:

        1. hover over the first menuitem
        2. select the first subitem 'Test1'
        3. the sub menuitem's actionlistener will be called and executed as expected and
        4. right after that the focus is set to the next menubar component which causes its submenus to expand automatically

        This might be a bit confusing for the user. I would expect that after the action has been executed the submenus of another menuitem should only expand when
        a user explicitly clicks on a menuItem.

        Show
        yip.ng added a comment - From Michael: I tested it with the latest branch and besides a javascript error I get, everything seems to work fine now. The javascript error doesn't seem to have any impact on the functionality and occurs sporadically after some time of unresponsiveness of the client. The firebug error log is attached. Also, there's one more thing which I'm not sure of if it should be regarded as a bug or not. You can simply reproduce it by following the steps below: 1. hover over the first menuitem 2. select the first subitem 'Test1' 3. the sub menuitem's actionlistener will be called and executed as expected and 4. right after that the focus is set to the next menubar component which causes its submenus to expand automatically This might be a bit confusing for the user. I would expect that after the action has been executed the submenus of another menuitem should only expand when a user explicitly clicks on a menuItem.
        yip.ng made changes -
        Attachment js_error.jpg [ 11076 ]
        yip.ng made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        yip.ng added a comment -

        About the JS error:

        nsSessionStore.js (C:\Program Files\Mozilla Firefox\components\nsSessionStore.js) is a Firefox JS program. If you google the error, you will find a lot of people have had the same error. So it's nothing to do with ICEfaces?

        "This Error is being generated in the Firefox components script that stores the session data for a window."

        "I had that sort of nonsense when upgrading versions of FF and TB until I started removing all of the program directory prior to deploying the new version."

        "I uninstalled Firefox. Deleted the directory and removed the references in the registry. I then reinstalled a fresh copy of firefox and all plugins. So far I have not had any more problems."

        About the on hover event:

        This is expected behavior with the current menu item event handling logic. It is caused by the overlapping of menu item div's. To change this behavior, we need to figure out how to distinguish between the two types of hover event: normal hover event and hover event as a result of clicking an overlapping menu item div. (There could also be more than two layers of overlap and this could complicate things further?) And then we need to change the renderer and/or JavaScript accordingly.

        Show
        yip.ng added a comment - About the JS error: nsSessionStore.js (C:\Program Files\Mozilla Firefox\components\nsSessionStore.js) is a Firefox JS program. If you google the error, you will find a lot of people have had the same error. So it's nothing to do with ICEfaces? "This Error is being generated in the Firefox components script that stores the session data for a window." "I had that sort of nonsense when upgrading versions of FF and TB until I started removing all of the program directory prior to deploying the new version." "I uninstalled Firefox. Deleted the directory and removed the references in the registry. I then reinstalled a fresh copy of firefox and all plugins. So far I have not had any more problems." About the on hover event: This is expected behavior with the current menu item event handling logic. It is caused by the overlapping of menu item div's. To change this behavior, we need to figure out how to distinguish between the two types of hover event: normal hover event and hover event as a result of clicking an overlapping menu item div. (There could also be more than two layers of overlap and this could complicate things further?) And then we need to change the renderer and/or JavaScript accordingly.
        Ken Fyten made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Priority P2
        Resolution Fixed [ 1 ]
        Assignee Yip Ng [ yip.ng ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael Thiem
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: