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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
mdodd
Posts: 178
Registered: ‎07-19-2012
My Carrier: Three

NavigationPane::popAndDelete() not deleting the previous page

Hi,

I'm currently having an issue with a programatically-generated NavigationPane. I can push a page onto the NavigationPane, I can popAndDelete() that page (which is default behaviour regardless), but while the UI displays the first page the second page is deleted. As a result, when I push the second page onto the NavigationPane for a second time, I end up having to popAndDelete() two intstances of the second page. This continues to increase so that pushing the second page for the nth time results in having to popAndDelete() that page n times.

 

Here's the relevant code sections:

 

 

void ScreenLogin::gotoPINPage(QUrl url) {
	ScreenWeb *web = new ScreenWeb(url);

	// Configure the back button
	ActionItem *backAction = ActionItem::create();
	bool res = QObject::connect(backAction, SIGNAL(triggered()), this, SLOT(onBackTriggered()));

	// Add back button to web view
	NavigationPaneProperties::Builder properties = NavigationPaneProperties::create().backButton(backAction);
	web->getPage()->setPaneProperties(properties);
	Q_UNUSED(res);

	// Push the web view
	root->push(web->getPage());
}

 

/*!
 * Executed when the NavigationPane Back button is clicked
 */
void ScreenLogin::onBackTriggered() {
	root->popAndDelete();
}

 

/*!
 * Executed when the top pane of the NavigationPane has changed
 */
void ScreenLogin::onTopChanged(bb::cascades::Page* page) {

	qDebug() << "Root has " << root->children().count() << " children";

	if(root->children().indexOf(page) == 0) { // Login page

		if(hasTokenStored()) {
			setStatus("Logging in...", true);
			pushTwitterScreen();
		}
		else {
			setStatus("", false);
			containerConnect->setVisible(true);
			containerPin->setVisible(false);
		}

	}
}

 

The output from the qDebug statement in onTopChanged always reads "Root has n children", n being the number of times I have gone forwards and back. All of the above statements are executed in the app, I've checked with step debugging.

 

Any help would be greatly appreciated. Many thanks,

 



Did this post help you? If so, please make sure to "like" it!
Please use plain text.
BlackBerry Development Advisor
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: NavigationPane::popAndDelete() not deleting the previous page

Hi there,

 

There are issues with the NavigationPane, I would see this issue being related to the one described in JIRA:

https://www.blackberry.com/jira/browse/BBTEN-138

 

Could you please post a comment and vote for it if possible?

 

Thanks!

 

Martin

 

Please use plain text.
Developer
mdodd
Posts: 178
Registered: ‎07-19-2012
My Carrier: Three

Re: NavigationPane::popAndDelete() not deleting the previous page

No can do, I'm afraid. I get this error:

 

You cannot view this issue because you are not the issue reporter or assignee, a member of the project group, or a member of the issue group and this issue is closed or in triage.

If you think this message is wrong, please consult your administrators about getting the necessary permissions.

 

 



Did this post help you? If so, please make sure to "like" it!
Please use plain text.
Developer
soaman
Posts: 610
Registered: ‎03-03-2011
My Carrier: Mobitel

Re: NavigationPane::popAndDelete() not deleting the previous page

I have the same problem.
--------------------------------------------------------

Follow our developer blog on Slovenia BlackBerry Developer Group!
Please use plain text.
BlackBerry Development Advisor
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Carrier: developer

Re: NavigationPane::popAndDelete() not deleting the previous page

Try again.

 

Stuart

Please use plain text.