I am having a weird problem with my Blackberry Cascades application. I was trying to add a button to actionbar (at the bottom of the application). But when I test it in the Blackberry 10 Dev Alpha simulator (BB10_0_10.261) it seems that I have 2 (and sometimes 3) versions of the same button, as shown in the image below. While there should normally be only 1?
So what I do is adding a button to my page in QML like so:
NavigationPane {
Page {
Container {
layout: StackLayout {
}
ListView {
...
}
}
actions: [
ActionItem {
title: "New Event"
ActionBar.placement: ActionBarPlacement.OnBar // HERE
onTriggered: {
var page = newEventPage.createObject();
navigationPane.push(page);
}
attachedObjects: ComponentDefinition {
id: newEventPage
source: "addEvent.qml"
}
}
]
}
onPopTransitionEnded: {
page.destroy();
}
}
This code does not a lot more than adding a button "New Event" that will link to my "addEvent.qml"
But if I remove (or comment) the line Actionbar.placement: ActionBarPlacement.OnBar
(marked with HERE
in the code above), I only get 1 button as was expected. But this button is situated in the overflow menu, while I want it on the ActionBar at the bottom.
All the different versions of the buttons do exactly the same thing (the expected behaviour by the way: opening addEvent.qml).
What I've already tried: "Clean.." and then "Rebuild"; this didn't work. I also tried to move the actions-array to other places, as I thought this could be on the wrong place, but this didn't help either. Removing the application on the simulator, and then reinstalling it.
I also tried it on a different computer, and other simulator, as I thought it could maybe be my computer. But I had the same problem there.
I don't know if this is a bug or not, but I guess I am doing something wrong, since I don't have a lot of experience in Cascades Development. I have looked everywhere, but haven't anybody else with the same problem. I haven't tested it on a real device, because I don't have a BB10 device (yet).