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
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
Accepted Solution

How to show the menu?

[ Edited ]

After I added the menu definition, whatever I operated the screen with menu, the menu could not be shown. Can someone point me out? Thank you.

 

TabbedPane {
    Menu.definition: MenuDefinition {    
        // Specify the actions that should be included in the menu
        actions: [
            ActionItem {
                title: "Action 1"
                onTriggered: {
                    console.log("Menu - Action1Triggered()")
                }
            },
            ActionItem {
                title: "Action 2"
                onTriggered: {
                    console.log("Menu - Action2Triggered()")
                }
            },
            ActionItem {
                title: "Action 3"
                    onTriggered: {
                    console.log("Menu - Action3Triggered()")
                } } ] // end of actions list } ...

 or

NavigationPane {
    id: nav
    
     Menu.definition: MenuDefinition {    
            // Specify the actions that should be included in the menu
            actions: [
                ActionItem {
                    title: "Action 1"
                    //   imageSource: ""
                    onTriggered: {
                        console.log("Menu - Action1Triggered()")
                    }
                },
                ActionItem {
                    title: "Action 2"
                    //  imageSource: ""
                    onTriggered: {
                        console.log("Menu - Action2Triggered()")
                    }
                },
                ActionItem {
                    title: "Action 3"
                    onTriggered: {
                        console.log("Menu - Action3Triggered()")
                    }
                }
            ] // end of actions list
        }

 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: How to show the menu?

Does anyone know the answer? :Helpsmilie:




p(^_^)q
Good good study, day day up
Please use plain text.
Contributor
radwon
Posts: 18
Registered: ‎09-28-2012
My Device: BlackBerry 10

Re: How to show the menu?

Your code is fine. Just swipe down from the top of the screen to reveal the Menu.

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: How to show the menu?

Thank you. I tried with your solution. Only the NavigationPane can show the menu, the TabbedPane could not show the menu either. Is the way different between NavigationPane to show the menu from the TabbedPane?




p(^_^)q
Good good study, day day up
Please use plain text.
Contributor
radwon
Posts: 18
Registered: ‎09-28-2012
My Device: BlackBerry 10

Re: How to show the menu?

No, it's exactly the same for both NavigationPane and TabbedPane.

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: How to show the menu?

Yes, i think so. But it doesn't work. Weird.




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: How to show the menu?

Hi! I've created a new Tabbed pane project in Momentics and pasted the code from the first post to the beginning of TabbedPane declaration:

 

TabbedPane {
    Menu.definition: MenuDefinition {    
            // Specify the actions that should be included in the menu
            actions: [
                ActionItem {
                    title: "Action 1"
                    onTriggered: {
                        console.log("Menu - Action1Triggered()")
                    }
                },
                ActionItem {
                    title: "Action 2"
                    onTriggered: {
                        console.log("Menu - Action2Triggered()")
                    }
                },
                ActionItem {
                    title: "Action 3"
                        onTriggered: {
                        console.log("Menu - Action3Triggered()")
                    }
                }
            ] // end of actions list
        }
    showTabsOnActionBar: true
    Tab {
...

When I drag from the top of the screen the menu appears so it seems that the code is correct.

 

When you try to open the menu do you see a black empty bar? If not, can you please check that you aren't disabling the menu application wide (Application.menuEnabled property)?

 

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900

Re: How to show the menu?

[ Edited ]

I have one NavigationPane screen with a TabbedPane sheet in my application. The NavigationPane can show the menu but the TabbedPane sheet could not show. Maybe I got the reason, the sheet can not have its separate menu.

 

BTW, I also noticed that all the screens which are pushed by the Navigation Pane will share one application menu except the sheet.




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
rcebryk
Posts: 84
Registered: ‎12-01-2012
My Device: 9790

Re: How to show the menu?

Yes, the Menu can't be shown on the sheet.
Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.
Please use plain text.