ICEfaces
  1. ICEfaces
  2. ICE-3640

menuItem used with attribute link doesnt work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.8DR#2, 1.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Java 1.5, OC4J-Appserver
    • Workaround Exists:
      Yes
    • Workaround Description:
      set attribute onclick="return true;"

      Description

      Since introducing attribute "onclick" to menuItem (see issue ICE-2745), when using menuItem as a simple link instead of action/actionListener, the generated defaultvalue of onclick renders to "return false;". This leads to the situation, that nothing happens, when clicking on such a menuitem. See source MenuItemRenderer.java, function makeTopLevelAnchor line 286:

          anchor.setAttribute(HTML.ONCLICK_ATTR, "return false;");

      That function is called in line 672 for non-action-menuItems on toplevel.

      Also note that non-toplevel-menuItems with link do not seem to have that problem (see function makeAnchor) because the onlcik-attribute is not set to a defaultvalue.

        Activity

        Hide
        Mark Collette added a comment -

        Now it will only render "return false;" for the onclick attribute if the link attribute and the onclick attribute are not set.

        TRUNK
        Subversion 17797
        icefaces\component\src\com\icesoft\faces\component\menubar\MenuItem.java
        icefaces\component\src\com\icesoft\faces\component\menubar\MenuItemRenderer.java

        Show
        Mark Collette added a comment - Now it will only render "return false;" for the onclick attribute if the link attribute and the onclick attribute are not set. TRUNK Subversion 17797 icefaces\component\src\com\icesoft\faces\component\menubar\MenuItem.java icefaces\component\src\com\icesoft\faces\component\menubar\MenuItemRenderer.java

          People

          • Assignee:
            Unassigned
            Reporter:
            Wolfgang Schröder
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: