I'm new to Blackberry Cascades
and I want to create a simple NavigationPane
. I'm very used to Qt's StackView
which allouse you to push and pop pages to and from the stack. However, Qt's [StackView][1]
has this attached property called Stack.view
which allows you to access the stack from any child page.
How can I do this in Blackberry's Cascades? Is it possible to access the NavigationPane
stack of pages from the current page you're in? I see this extremely useful.
For example I have this simple project with two qml files each representing one page:
Main page:
// main.qml
import bb.cascades 1.4
NavigationPane {
id: nav
Page {
Container {
ListView {
dataModel: XmlDataModel {
source: "data.xml"
}
onTriggered: {
if (indexPath.length > 1) {
var chosenItem = dataModel.data(indexPath);
var contentpage = itemPageDefinition.createObject();
contentpage.itemPageTitle = chosenItem.name
nav.push(contentpage);
}
}
accessibility.name: "Listing"
}
}
}
attachedObjects: [
ComponentDefinition {
id: itemPageDefinition
source: "ItemPage.qml"
}
]
onPopTransitionEnded: {
page.destroy();
}
}
Secondary page:
// ItemPage.qml
import bb.cascades 1.4
Page {
property alias itemPageTitle: titlebar.title
titleBar: TitleBar {
id: titlebar
}
content: Container {
}
}
Is it possible to access nav
or NavigationPane
from ItemPage.qml
? I would like e.g. to create a new page from ItemPage.qml
and push it on the stack. Is it possible to do so?
EDIT:
For example there is this documentation page on the Blackberry developers website which has this example with a main page:
and a secondary page:
As you can see, in the secondary myPage.qml
he uses the navigationPane
. How is that possible? How does he have access to an ID present in another component?