Remove command from sideMenu issue

62 views
Skip to first unread message

candid...@gmail.com

unread,
Oct 31, 2017, 10:03:28 AM10/31/17
to CodenameOne Discussions
I'm having some trouble modifying SideMenu commands since the last JavaSE update.

  Test case below shows the problem. Expected result is: clicking on the command will remove it. Actual result is: clicking in the command doesn't seem to do anything. 

    Toolbar.setGlobalToolbar(true);
    Form hi = new Form("Entrada");
    Style s = UIManager.getInstance().getComponentStyle("TitleCommand");
    FontImage icon = FontImage.createMaterial(FontImage.MATERIAL_WARNING, s);

    Command cmd = hi.getToolbar().addCommandToRightBar("Bla", null, (e) -> Log.p("Bla"));
    hi.getToolbar().addCommandToSideMenu("Remove", null, (e) -> {
      hi.removeCommand(cmd);
      hi.revalidate();
    });
    
    Also, after adding commands to the sidebar, hi.getCommandCount() returns 0.
    
    Is this a deliberate change? Is there a better way of making "dynamic" SideMenu's? (being able to remove certain commands and put new ones).

Shai Almog

unread,
Nov 1, 2017, 1:21:54 AM11/1/17
to CodenameOne Discussions
Thanks, this is probably a regression due to the recent migration to on-top side menu: https://www.codenameone.com/blog/pixel-perfect-on-top-menu.html

Please file an issue we'll try to fix this before the code freeze.

daniel...@bitxenio.com

unread,
Nov 1, 2017, 5:28:44 AM11/1/17
to CodenameOne Discussions
Hi Shai

I have filled a Issue:


Best Regards

Shai Almog

unread,
Nov 2, 2017, 2:33:36 AM11/2/17
to CodenameOne Discussions
Thanks this should be fixed in git and we'll push out an update later today. However, for future reference the place for Codename One issues is here: http://github.com/codenameone/CodenameOne/issues/

Sorry I should have clarified that ;-)

ka...@bitxenio.com

unread,
Nov 2, 2017, 8:51:34 AM11/2/17
to CodenameOne Discussions
Hi Shai

we received and notification from github thats the issue was fixed, but the issue still remains.

I updated the issue post:




Best Regards

Shai Almog

unread,
Nov 3, 2017, 1:25:20 AM11/3/17
to CodenameOne Discussions
Hi,
did you use "update client libs" in Codename One Settings under "Basic" to fetch the latest update?

ka...@bitxenio.com

unread,
Nov 3, 2017, 4:59:23 AM11/3/17
to CodenameOne Discussions
Yes I did.

Best Regards

Shai Almog

unread,
Nov 4, 2017, 1:33:24 AM11/4/17
to CodenameOne Discussions
We made another fix for this. When we push out a new client lib it should be fixed. We'll do that today or tomorrow.

avner...@gmail.com

unread,
Nov 7, 2017, 2:17:45 AM11/7/17
to CodenameOne Discussions
Hi Shai,
I posted more issues on the new side menu implementation
Thanks

Shai Almog

unread,
Nov 7, 2017, 11:52:10 PM11/7/17
to CodenameOne Discussions
Hi,
I noticed you posted it in one of our demo projects. I disabled issue tracking there as it's clearly not the place for Codename One issues.

You mentioned a couple of things, the former is already fixed and was fixed yesterday so make sure you updated the libs (notice we released more than one update over the weekend).
The RTL support issue is an RFE we should address, it should be easier to extend the on-top menu now that it's the default but that will have to go into the next update.
Reply all
Reply to author
Forward
0 new messages