-
27 Jul 2009 12:47 AM #1
[CLOSED] [2.0.1] Combobox in MenuItem doesn't work
[CLOSED] [2.0.1] Combobox in MenuItem doesn't work
Hi,
As said by JDThermo here: http://extjs.com/forum/showthread.ph...ht=HideOnClick , I found that Combobox can be added in Menu but selection (via a click) doesn't work (it's ok with keyboard selection)
Code:public class Test implements EntryPoint { public void onModuleLoad() { Viewport viewport = new Viewport(); viewport.setLayout(new FitLayout());Button item1 = new Button("Button w/ Menu"); ToolBar toolBar = new ToolBar();Menu menu = new Menu();final Menu optionMenu = new Menu(); MenuItem options = new MenuItem("Options");optionMenu.add(new MenuItem("Loading ..."));optionMenu.addListener(Events.BeforeShow, new Listener<MenuEvent>(){public void handleEvent(MenuEvent be) { DeferredCommand.addCommand(new Command(){public void execute() { // Point p = optionMenu.getPosition(false); optionMenu.removeAll(); optionMenu.hide(); for (int i = 0; i < 5; i++) { SimpleComboBox<String> combo = new SimpleComboBox<String>();combo.setEmptyText("Select a state..."); combo.add("TATA"); combo.add("TOTO");// AdapterMenuItem adapterMenuItem = new AdapterMenuItem(combo); optionMenu.add(combo); // adapterMenuItem.setHideOnClick(false); } optionMenu.show();} }); optionMenu.removeListener(Events.BeforeShow, this); be.setCancelled(true); } });options.setSubMenu(optionMenu); menu.add(options);item1.setMenu(menu); toolBar.add(item1);ContentPanel panel = new ContentPanel(); panel.setCollapsible(true); panel.setFrame(true); panel.setHeading("Test"); panel.setLayout(new FitLayout()); panel.setTopComponent(toolBar);viewport.add(panel);viewport.layout(); RootPanel.get().add(viewport); }}FYI: I have the same problem with the ThemeSelector (it doesn't work in MenuItem)
-
27 Jul 2009 1:27 AM #2
This is by design. You can extend ComboBox and change the place where the list gets rendered. I am closing this issue.
-
10 Nov 2009 9:41 AM #3
I have added back AdapterMenuItem and modified Menu to work with the hideOnClick config. The changes are in SVN in the trunk and will be available in our next release (2.1).
Code:AdapterMenuItem adapterMenuItem = new AdapterMenuItem(combo); adapterMenuItem.setHideOnClick(false); optionMenu.add(adapterMenuItem);
-
2 Feb 2010 1:55 PM #4
The same happens when I add the combobox to the tools of the start menu.
The same happens when I add the combobox to the tools of the start menu.
Hi
I still have the same issue. It occurs when I add the combobox (wrapped by AdapterMenuItem) to the tools of the start menu in the desktop.
When I looked at the source code it seems that the tools menu is not in fact the menu subclass and probably that's why it doesn't respect AdapterMenuItem.setHideOnClick(false).
I could fix this by myself but unfortunately the design of the desktop class is not very friendly, when it comes to change the default implementation of the one of the internal classes, (StartMenu,TaskBar etc).
I'm using the revision 1895.Marcin Misiewicz
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote