Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 179
Registered: ‎09-11-2009
My Device: Not Specified

How To Keep Menu Displayed when Showing Custom SubMenu

I'm trying to create my own submenu that will behave like whatever RIM is using for their submenus.

 

I've created a submenu using an ObjectListField and a PopupScreen.  I've created a MenuItem that invokes the submenu when clicked.

 

Here's my problem:  The original menu does not stay visible when the submenu appears...so the submenu looks like a popupscreen instead of a submenu.

 

What do I need to override to keep the original menu visible when the popupscreen is displayed?

 

Here's the code I've attempted so far.  This is an inner class that extends MenuItem:

 

 

public class subMenuItem extends MenuItem
{

    public subMenuItem(String text, int ordinal, int priority)
    {
        super(text, ordinal, priority);
    }

        public void run()
        {
            Menu menu = getMenu(0);
            while(menu.getSelectedItem() == this)
            {
                if(menu.isDisplayed() == false);
                menu.show();
            }
        }

 

Ideally I'd use this to create a MenuItem that keeps the original menu visible when the submenu is displayed.

 

Developer
Posts: 179
Registered: ‎09-11-2009
My Device: Not Specified

Re: How To Keep Menu Displayed when Showing Custom SubMenu

Bumping to the top for additional help.

Also wanted to add that I did attempt to override makeMenu on the MainScreen for which I'm creating the submenu, but when I did no menu appeared.

 

Thanks