Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Sep 2008
    Posts
    43
    Vote Rating
    0
    mike07 is on a distinguished road

      0  

    Default [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)

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is by design. You can extend ComboBox and change the place where the list gets rendered. I am closing this issue.

  3. #3
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    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);

  4. #4
    Ext GWT Premium Member misqu's Avatar
    Join Date
    Aug 2008
    Location
    Poland
    Posts
    42
    Vote Rating
    0
    misqu is on a distinguished road

      0  

    Default 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

Thread Participants: 3