hamburger menu command not respecting enabled (disabled)

51 views
Skip to first unread message

benj...@gmail.com

unread,
Nov 14, 2013, 5:54:55 PM11/14/13
to codenameone...@googlegroups.com
Hi,

i'm using in my styling the hamburger menu and setting some commands to command.setEnabled(false) buth they still keep active and get into there actionPerformed what i want to do is depending of the user is some parts of the Side menu will be enabled and disabled buth the hamburger menu is not working well with that how can i fix this?

Using in constants commandBehavior -> bar the commands are disabled so is this a bug or just is the way the hamburger menu will work ?

Greetings and thank for all the help

Shai Almog

unread,
Nov 15, 2013, 1:22:54 AM11/15/13
to codenameone...@googlegroups.com, benj...@gmail.com
Hi,
did you set them to enabled false before adding them to the menu?
Setting enabled after adding will have no effect.

You can block the logic in action performed by checking isEnabled() but we normally block this in the Button level which is set when the command is added.

benj...@gmail.com

unread,
Nov 15, 2013, 2:55:09 PM11/15/13
to codenameone...@googlegroups.com, benj...@gmail.com
Thank you for your reply,

I use the following code


        final Command listaBuscadorCommand;
        listaBuscadorCommand = new Command(Esp.FORMBBRECENTES){
          public void actionPerformed(ActionEvent evt)  {
              frmPrincipal.getContentPane().removeAll();
              frmPrincipal.addComponent(BorderLayout.CENTER, buscadorListaComponent.showBuscador());
              frmPrincipal.revalidate();
          }
        };
        listaBuscadorCommand.setEnabled(false);
        frmPrincipal.addCommand(listaBuscadorCommand);

so it's before it's added to the from or how should i use it?

Greetings

Shai Almog

unread,
Nov 15, 2013, 4:27:08 PM11/15/13
to codenameone...@googlegroups.com, benj...@gmail.com
Should work. I'll have a look at this. Can you please file an issue on that.
Thanks.
Reply all
Reply to author
Forward
0 new messages