05-10-2012 07:56 AM
I have read here https://bdsc.webapps.blackberry.com/devzone/blackb
When assigning a contextmenu to a control inside a ListItemComponent, it doesn't seem possible to reference the id of the surroudning page or container from inside the ActionItem's onTriggered
I get this runtime error: ReferenceError: Can't find variable: navigationPane
ActionItem {
imageSource: "asset:///images/myimage.png"
onTriggered: {
navigationPane.deprecatedPushQmlByString ("NextScreen.qml");
}
}
So how can I implement this use case in QML:
1) Have a list displayed in the UI
2) Long press on an item
3) The pressed item will become selected and the context menu pops up
4) The user selects an action from the context menu that pushes the next View onto the stack
05-10-2012 08:11 AM
take a look at the definition of your NavigationPane, does it have the correct id? In your case it should be navigationPane.
NavigationPane {
id: navigationPane
05-10-2012 08:17 AM
05-10-2012 08:26 AM
05-12-2012 03:47 PM
Since it's deprecated so I suggest you not to use it. In stead, you can have other options such as attachedObjects which holds sme Pages and just push them when need.
attachedObjects: [
Page {
id: firstPage
content: Container {
Label {
text: "First attachedObjects Page"
}
}
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
navigationPane.pop ();
}
}
}
},
Page {
id: secondPage
content: Container {
Label {
text: "Second attachedObjects Page"
}
}
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
navigationPane.pop ();
}
}
}
}
]Or control the push and pop from C++