there was a typo in that code i meant to put: 

smbForRightMenu.add(SideMenuRIGHT);
            smbForRightMenu.putClientProperty("SideComponent", 
SideMenuRIGHT);

I tried the second approach just in case, think I read it on the blog, but 
neither seem to do it.

On Wednesday, August 3, 2016 at 7:15:42 PM UTC+8, Gareth Murfin wrote:
>
> No matter how often I try, I find the whole side menu thing quite 
> confusing. Until now I have had to avoid right hand side menus because I 
> simply cannot get them to work. Left hand side I have been able to get 
> working using Toolbar, roughly something like this:
>
> Toolbar toolbarForLeftMenu;
>
> if (toolbarForLeftMenu==null)
>         {
>             toolbarForLeftMenu = new Toolbar();
>         }
>         
>         toolbarForLeftMenu.setHidden(true);
>         f.setToolbar(toolbarForLeftMenu);
>     
>         final Container SideMenuLEFT = 
> (Container)this.createContainer(resources, "SideMenuLEFT");
>   
>         toolbarForLeftMenu.addComponentToSideMenu(SideMenuLEFT);
>
> That works great. However I also need a right menu, which you cannot do 
> with the Toolbar  as far as I am aware. So I am trying to add a right menu 
> by using SideMenuBar, this actually opens up the side bar fine but I cannot 
> work out how to actually add my container to it, here is what I am doing, 
> but it always remains empty:
>
> final Container SideMenuRIGHT = (Container)this.createContainer(resources, 
> "SideMenuRIGHT");        
>         
>         if (smbForRightMenu==null)
>         {
>             smbForRightMenu = (SideMenuBar) 
> Display.getInstance().getCurrent().getMenuBar();
>             smbForRightMenu.add(SideMenuRIGHT);
>             smbForRightMenu.putClientProperty("SideComponent", 
> smbForRightMenu);//revalidate();
>             _("added content to the right menu...");
>         }
>         
> smbForRightMenu.openMenu(SideMenuBar.COMMAND_PLACEMENT_VALUE_RIGHT);
>
> So basically my question is, why doesnt my container (SideMenuRIGHT) 
> appear on the right menu when it opens up ?
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/8c347ab8-ecc6-472e-b130-9be58c429988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to