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: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Not able to see back button when pushing a page into navigation pane

Hi,

 

I am creating a navigation pane in c++ and trying to push a page into that navigation pane and doing setBackButtonsVisible(true), but while i am seeing the page its not showing the back button.

i want to visible that back button.

 

Below is the sample code. 

QmlDocument *pqmlDoc = QmlDocument::create("asset:///Provisioning/pages/SettingPage.qml").property("manager", this);																																.property("globals",AppGlobal::sharedInstance());
pCurrentPage = pqmlDoc->createRootObject<Page>();
pqmlDoc->setParent(pCurrentPage);

Page* settingsPage = pCurrentPage;
settingsPage->setProperty("percent",floor(percent*100.0)/100.0);
QMetaObject::invokeMethod(settingsPage, "updateText");

NavigationPane *pnavPaneSetting = NavigationPane::create();
ActionItem *customBackButton = ActionItem::create().onTriggered(pnavPaneSetting, SLOT(pop()));
NavigationPaneProperties *npp = new NavigationPaneProperties;
npp->setBackButton(customBackButton);

settingsPage->setPaneProperties(npp);
pnavPaneSetting->setBackButtonsVisible(true);
pnavPaneSetting->push(settingsPage);
Application::instance()->setScene(pnavPaneSetting);

 Thanks.


----------------------------------------------------------
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.
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: Not able to see back button when pushing a page into navigation pane

is any one know the solution. ?


----------------------------------------------------------
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.
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Not able to see back button when pushing a page into navigation pane

I believe the NavigationPane should be the one that you create first as the root object.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Highlighted
Developer
Posts: 263
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Not able to see back button when pushing a page into navigation pane

what do you want when the back button is clicked?
--tom
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: Not able to see back button when pushing a page into navigation pane

Hi,

 

I just want to pop that page but back button not creating while pushing the page into that created navigation pane.


----------------------------------------------------------
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.
Developer
Posts: 263
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Not able to see back button when pushing a page into navigation pane

[ Edited ]

Let's assume that there is a back button and the user is able to click on it to pop the current page, what will the user see after this?

--tom
Developer
Posts: 47
Registered: ‎11-23-2010
My Device: Q10
My Carrier: Rogers

Re: Not able to see back button when pushing a page into navigation pane

[ Edited ]

I would write something like this if I need to keep your code:

 

 

QmlDocument *pqmlDoc = QmlDocument::create("asset:///Provisioning/pages/SettingPage.qml").property("manager", this);

NavigationPane *pnavPaneSetting = pqmlDoc->createRootObject<NavigationPane>();
Page* settingsPage;
settingsPage = Page::create();
ActionItem *customBackButton = ActionItem::create().onTriggered(pnavPaneSetting, SLOT(pop()));
NavigationPaneProperties *npp = new NavigationPaneProperties;
npp->setBackButton(customBackButton);

pnavPaneSetting->setPaneProperties(npp);

pnavPaneSetting->push(settingsPage);
Application::instance()->setScene(pnavPaneSetting);

 I didn't save exactly 100% of your code but most of it. The main idea that RootObject has to be NavigationPane, not Page. If need the Page then with little tweak you can add Page on NavigationPane.

 

Should work Smiley Happy

 

btw, you don't really need the "setBackButtonsVisible(true)" it's gonna be visible without it

 

Regards

 

Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: Not able to see back button when pushing a page into navigation pane

Thanks for your reply.

its not working for me app crashing while applying this code,

 

but i solve the problem in another way..

 


----------------------------------------------------------
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.