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
ankur_siwach
Posts: 148
Registered: ‎09-28-2012
My Device: Blackberry Developer

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
ankur_siwach
Posts: 148
Registered: ‎09-28-2012
My Device: Blackberry Developer

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

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
Developer
tommy20
Posts: 262
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
ankur_siwach
Posts: 148
Registered: ‎09-28-2012
My Device: Blackberry Developer

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
tommy20
Posts: 262
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
scrudrv
Posts: 46
Registered: ‎11-23-2010
My Device: Q10

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 :smileyhappy:

 

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

 

Regards

 

Developer
ankur_siwach
Posts: 148
Registered: ‎09-28-2012
My Device: Blackberry Developer

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.