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

        Hide
        Michael Thiem added a comment -

        backing bean code

        Show
        Michael Thiem added a comment - backing bean code
        Hide
        Michael Thiem added a comment -

        singleton menu model data

        Show
        Michael Thiem added a comment - singleton menu model data
        Hide
        Michael Thiem added a comment -

        table model data

        Show
        Michael Thiem added a comment - table model data
        Hide
        Michael Thiem added a comment -

        sample jspx file

        Show
        Michael Thiem added a comment - sample jspx file
        Hide
        Michael Thiem added a comment -

        tested on tomcat 5.5

        Show
        Michael Thiem added a comment - tested on tomcat 5.5
        Hide
        Michael Thiem added a comment -

        sources

        Show
        Michael Thiem added a comment - sources
        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
        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.
        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.
        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)
        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.
        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.
        Hide
        yip.ng added a comment -

        Working war file for Tomcat 6.

        Show
        yip.ng added a comment - Working war file for Tomcat 6.
        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.
        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).
        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.
        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.)
        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.
        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 .
        Hide
        yip.ng added a comment -

        Fixed. See screenshot-8.

        Show
        yip.ng added a comment - Fixed. See screenshot-8.
        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: