weird behavior of MenuItems with multiple submenus

0 views
Skip to first unread message

woiff

unread,
Sep 5, 2008, 12:04:10 AM9/5/08
to Google Web Toolkit
With GWT 1.5.2 I'm seeing some unexpected behavior in vertical
MenuBars having 2 or more cascading submenus. In the example below I
have 3 MenuBars, where Menu 2 is a submenu of Item 1A and Menu 3 is a
submenu of Item 2A. All 3 MenuBars have autoopen=false and I use a
dummy Command for MenuItems not having submenus.

Item 1A
|-->Item 2A
|-->|-->Item 3A
|-->|-->Item 3B
|-->Item 2B
|-->Item 2C
Item 1B
Item 1C

If I click over Item 1A, Menu 2 opens as expected. But as I mouseover
Item 2A, Menu 3 immediately autoopens. Since autoopen=false for all
menus, shouldn't I have to click Item 2A for Menu 3 to open?

If I click over Item 1A when Menu 2 is already open, then Menu 2
closes and reopens. That seems appropriate. However, when I click
over Item 2A when Menu 3 is already open, then both Menu 2 and Menu 3
close, while Menu 1 remains open. Shouldn't Menu 2 remain open and
Menu 3 closes and reopens?

Am I wrong and this is expected behavior?

Here's the code:

Command cmd = new Command() {public void execute(){}};

MenuBar menu3 = new MenuBar(true);
MenuItem item3a = new MenuItem("Item 3A",false,cmd);
MenuItem item3b = new MenuItem("Item 3B",false,cmd);
menu3.addItem(item3a);
menu3.addItem(item3b);

MenuBar menu2 = new MenuBar(true);
MenuItem item2a = new MenuItem("Item 2A",false,menu3);
MenuItem item2b = new MenuItem("Item 2B",false,cmd);
MenuItem item2c = new MenuItem("Item 2C",false,cmd);
menu2.addItem(item2a);
menu2.addItem(item2b);
menu2.addItem(item2c);

MenuBar menu1 = new MenuBar(true);
MenuItem item1a = new MenuItem("Item 1A",false,menu2);
MenuItem item1b = new MenuItem("Item 1B",false,cmd);
MenuItem item1c = new MenuItem("Item 1C",false,cmd);
menu1.addItem(item1a);
menu1.addItem(item1b);
menu1.addItem(item1c);

woiff

unread,
Sep 5, 2008, 10:35:55 AM9/5/08
to Google Web Toolkit
To see what kind of events the MenuBar is receiving, I subclass it and
override the onBrowserEvent. When clicking each of the MenuItems, all
of the items below receive the click event except Item 2A. I think we
have a bug here.
Reply all
Reply to author
Forward
0 new messages