08-08-2012 04:13 AM
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(back Action);
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,
08-14-2012 10:33 AM
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
08-14-2012 11:14 AM
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.
08-14-2012 12:16 PM
08-14-2012 12:17 PM
Try again.
Stuart