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
New Contributor
Posts: 4
Registered: ‎12-28-2012
My Device: BB10
My Carrier: Airtel

Add and remove Application Menu.

Hi All,

 

I am using TabPane and on the first active tab page i want to show two application menus,

and from this page on clicking on any button i am navigating to another page and here on this page i want to show three application menu.

 

I am using like this Application.menu.removeAction(actionItemId);

but if i use this code of line in onCreationCompleted{} block it shows error 

TypeError: Result of expression 'Application.menu' [null] is not an object.

but if i use this code in onTriggered{} block it works fine.

 

So how to do this one?

Please provide any suggestion.

 

 

Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Add and remove Application Menu.

[ Edited ]

Where you use onCreationCompleted signal?

Maybe is not yet created Application Menu if you use onCreationCompleted{} on the TabPage.

Try to use onCreationCompleted inside your menu



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Add and remove Application Menu.

i use the onTopChanged signal to check for the objectName, based on that property i set Application.menuEnabled to true or false.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Retired
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Add and remove Application Menu.

Hi neha_bb10,

 

From a design perspective, it is not recommended to change your application menu based on the page in your app. Based on the BlackBerry 10 UI guidelines, "the application menu holds important actions that are common for the application and aren't context-specific (for example, Settings, Log Out, or Help)." You might want to consider adding those context-specific actions to the action menu instead.

 

Hope that helps!

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Add and remove Application Menu.

if you show your settings menu on the settings page that would be a bit strange, wouldn't it?
or "logs" on the logs page?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Retired
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Add and remove Application Menu.

Hi simon_hain,

 

That's why it's recommended that you have your settings page defined on a Sheet and not as part of your main app navigation control. On the other hand, the app menu isn't accessible from a Sheet.

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker