07-23-2012 02:41 PM - edited 07-23-2012 02:44 PM
Hi guys !
NavigationPane has very annoying issue. Example code from documentation page , section "Defining screens as attached objects"
import bb.cascades 1.0
NavigationPane {
id: navigationPane
Page {
content: Container {
Button {
text: "Display first Page"
onClicked: {
navigationPane.push (firstPage);
}
}
Button {
text: "Display second Page"
onClicked: {
navigationPane.push (secondPage);
}
}
} // end of Container
} // end of Page
attachedObjects: [
Page {
id: firstPage
content: Container {
Label {
text: "First attachedObjects Page"
}
}
// Override the default back button to just pop the current
// screen off of the stack, instead of pop and delete
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
navigationPane.pop ();
}
}
}
},
Page {
id: secondPage
content: Container {
Label {
text: "Second attachedObjects Page"
}
}
// Override the default back button to just pop the current
// screen off of the stack, instead of pop and delete
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
navigationPane.pop ();
}
}
}
} // end of Page
] // end of attachedObjects list
} // end of NavigationPane
This shows 2 buttons: one form display the first Page, and other for display second page.
When you click on button for display first page, the page is displayed, OK.
But if you click again in the same button, page is not displayed !!! Only occurs at Beta 2.
Tested with Dev Alpha Device.
push( ) or pop ( ) bug ?
Solved! Go to Solution.
07-23-2012 05:42 PM
Any idea?
07-24-2012 06:17 PM
Help me, please.
07-24-2012 10:15 PM
hmm, I define the back button outside of the pages just in the navigation pane like:
NavigationPane {
signal resetPage()
id: homeNav
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
title: "Return"
onTriggered: {
homeNav.pop();
}
}
}
And mine works fine, maybe a bug with your method?
07-25-2012 05:26 AM - edited 07-25-2012 05:27 AM
I have changed back button definition. The same result ... very very strange.
When i tap back button, this message error shows in console :
--------------------------------------------------
Context: Failed to find target node with id 0
--------------------------------------------------
I view this messages in console at start of app too :
----------------------------------
ERROR:: QNXPpsSubscriptionServer: QNXPpsSubscriptionServer::createObject: (13) Failed to create dir /pps/services/automation/framework
ERROR:: QNXPpsSubscriptionServer: QNXPpsSubscriptionServer::subscribe: Failed to open /pps/services/automation/framework/control?delta,n
----------------------------------
In release notes, "Known Issues" shows this :
--------------------------------------------------
When a Page is popped off of a NavigationPane using the pop() function, the Page is sometimes deleted by the garbage collector. The pop() function incorrectly sets the parent of the Page to NULL, which makes it a viable candidate for destruction by the garbage collector. This issue also occurs when garbage collection is triggered manually.
Workaround: Use the depracated push() function instead.
--------------------------------------------------
https://developer.blackberry.com/cascades/download
Perhaps pop() destroying content or attachedObjects malfunction ?? I don't know.
07-25-2012 09:42 AM
Very interesting, I do use deprecated push, while the alternative push caused me similar problems in beta 1, I did not know there was a lingering issue.
07-25-2012 10:01 AM - edited 07-25-2012 11:08 AM
It's work with deprecated push, but I would like some guy from blackberry would confirm this issue.
I think do use Sheet instead until this annoying bug fixes.
Thanks, vingilot!
07-26-2012 10:45 AM
A general question: Are you able to properly run the Navigation Pane example from the Beta 2 templates?
Martin
07-26-2012 02:52 PM - edited 07-26-2012 02:56 PM
Yes. deprecatedPushQmlByString() method works well.
The problem is when i use push() method ( through attachedObjects )
If you run code at my first post message, you will view the problem : Tap "Display first Page" button, "Back" and tap "Display first Page" again.
NavigationPane only works once, not twice.
07-26-2012 05:36 PM
I'm not alone...