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

Native Development

Reply
Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Application Menu

Trying to add application menu's to my app and I am running into some issues.

 

I am getting them to show up for Help and Settings. No problem here. And I am able to get it to go to my help and settings page. Great so far.

 

Now the problem. While viewing my help or settings page the application menu is still available on those pages. The user is able to continue to go to say the settings page over and over again from the applications menu and when they finally get around to clicking the back button on the settings page they find themselves going back to the settings page again for as many times as they continued to select it from the applications menu.

 

I need to pop all pages from the stack so that whatever application menu page is selected it clears all pages on the stack if they decide to select a different application menu.

 

My code I am using is as follows. I am using application menu with my NavigationPane

 

    Menu.definition: MenuDefinition {

        // Add a Help action

        helpAction: HelpActionItem {

            attachedObjects: ComponentDefinition {

                id: helpPage

                source: "help.qml"

            }

 

            // do something there

            onTriggered: {

                var page = helpPage.createObject();

                navigationPane.push(page);

            }

        }

 

        // Add a Settings action

        settingsAction: SettingsActionItem {

            attachedObjects: ComponentDefinition {

                id: settingsPage

                source: "settings.qml"

            }

            onTriggered: {

                //do something here

                //like show the settings screen

                var page = settingsPage.createObject();

                navigationPane.push(page);

            }

        }

    }

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Re: Application Menu

I can fix this with the navigateTo like this

 

onTriggered: {
                //do something here
                //like show the settings screen
                navigationPane.navigateTo(mainpage);
                var page = settingsPage.createObject();
                navigationPane.push(page);
            }

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Application Menu

I see you have suggested a solution to your own problem, but the way I prevent the user from being able to open a page over and over from the system menu is to have the "settings" or "help" page come up as a Sheet.  Because when a Sheet is called in the Application menu is no longer available (if the user swipes from the top, nothing will happen).

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Developer
Posts: 403
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Application Menu

Try searching on Application Menu. I have answered this in a couple of places with code.