ICEfaces
  1. ICEfaces
  2. ICE-6847

Dynamic menuItems actionListener called twice

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, EE-2.0.0.GA
    • Fix Version/s: 2.1-Beta, 3.0, EE-2.0.0.GA_P01
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 2.0 only

      Description

      When using a dynamic menuBar build with the <ice:mentItems> component, the actionListener that is set for each MenuItem object is called twice. Using the same code in ICEfaces 1.8.2 does not produce this behavior. Also using the standard menuItem component and assigning an actionListener does not reproduce the same results.

        Activity

        Hide
        Arran Mccullough added a comment -

        Test case that shows the issue, built for Tomcat

        Show
        Arran Mccullough added a comment - Test case that shows the issue, built for Tomcat
        Hide
        Keith Patel added a comment - - edited

        same behavior happens for actions as well.

        In the class MenuItems, the method processDecodes is calling super.processDecodes(context); . The issue seems MenuItems inherits from MenuItemBase, and in super.processDecodes (MenuItemBase.processDecodes) it iterates through the MenuItems children a second time.

        Show
        Keith Patel added a comment - - edited same behavior happens for actions as well. In the class MenuItems, the method processDecodes is calling super.processDecodes(context); . The issue seems MenuItems inherits from MenuItemBase, and in super.processDecodes (MenuItemBase.processDecodes) it iterates through the MenuItems children a second time.
        Hide
        yip.ng added a comment - - edited

        processDecodes() exactly the same in 2.0 as in 1.8. Yet problem doesn't occur in 1.8. Must be something else? Also code is not just used by case of dynamic menu items. Can't just blindly remove the super processDecodes()?

        Show
        yip.ng added a comment - - edited processDecodes() exactly the same in 2.0 as in 1.8. Yet problem doesn't occur in 1.8. Must be something else? Also code is not just used by case of dynamic menu items. Can't just blindly remove the super processDecodes()?
        Hide
        yip.ng added a comment - - edited

        The real problem is in javax.faces.component.UIComponentBase#getFacetsAndChildren. For the dynamic MenuItems component, it returns empty in 1.8 but the dynamically-added children in 2.0. See screenshot 1. I did a compare of the function from mojarra 1.2 and mojarra 2.0.3. They are exactly the same as well. Unexplainable at this level. Maybe something even deeper in the mojarra or framework code?

        Show
        yip.ng added a comment - - edited The real problem is in javax.faces.component.UIComponentBase#getFacetsAndChildren. For the dynamic MenuItems component, it returns empty in 1.8 but the dynamically-added children in 2.0. See screenshot 1. I did a compare of the function from mojarra 1.2 and mojarra 2.0.3. They are exactly the same as well. Unexplainable at this level. Maybe something even deeper in the mojarra or framework code?
        Hide
        Ken Fyten added a comment -

        Alright, pushing this back (out of 2.0.2) due to complexity.

        Show
        Ken Fyten added a comment - Alright, pushing this back (out of 2.0.2) due to complexity.
        Hide
        yip.ng added a comment -

        As per Mark's comments in mtg about different state-saving strategy in ICEfaces 2, safe to just remove call to super processDecodes.

        Revision: 24562


        Modified : /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/menubar/MenuItems.java

        Revision: 24563


        Modified : /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/compat/components/src/main/java/com/icesoft/faces/component/menubar/MenuItems.java

        Show
        yip.ng added a comment - As per Mark's comments in mtg about different state-saving strategy in ICEfaces 2, safe to just remove call to super processDecodes. Revision: 24562 Modified : /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/menubar/MenuItems.java Revision: 24563 Modified : /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/compat/components/src/main/java/com/icesoft/faces/component/menubar/MenuItems.java

          People

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

            Dates

            • Created:
              Updated:
              Resolved: