08-14-2012 10:04 AM
enabled: false property in StandardListItem just change UI to grey, but
nav.deprecatedPushQmlByString(chosenItem.file);
is working in enabled: false state
It's bug or not?
Solved! Go to Solution.
08-15-2012 05:21 PM
After some quick tests I think I'm seeing the same thing as you.
Do you have a small bit of sample QML?
Stuart
08-15-2012 06:51 PM
model.xml:
<model>
<header title="North America">
<item title="Toronto" enable="true" file="Toronto.qml"/>
<item title="New York" enable="false" file="NY.qml" />
</header>
<header title="Europe">
<item title="Copenhagen" enable="false" file="Copengagen.qml" />
<item title="Malmo" enable="true" file="Malmo.qml" />
</header>
</model>
and navigation like main.qml in cookbook cascades:
NavigationPane {
id: nav
Page {
id: recipeListPage
Container {
layout: DockLayout {
}
ImageView {
imageSource: "asset:///images/Book_background.png"
layoutProperties: DockLayoutProperties {
verticalAlignment: VerticalAlignment.Fill
horizontalAlignment: HorizontalAlignment.Fill
}
}
Container {
layout: DockLayout {
}
ListView {
id: recipeList
dataModel: XmlDataModel {
source: "models/model.xml"
}
listItemComponents: [
ListItemComponent {
type: "header"
HeaderListItem {
title: ListItemData.title
}
},
ListItemComponent {
type: "item"
StandardListItem {
title: ListItemData.title
enable: ListItemData.enabled
}
}
]
}
onTriggered: {
var chosenItem = dataModel.data(indexPath);
var recipePage = nav.deprecatedPushQmlByString(chosenItem.file);
}
}
}
}
}
result: after enable: false tabs don't work and you can't going to tab page, but in
nav.deprecatedPushQmlByString(chosenItem.file);
you can navigate to page.
P. S. It's just a example, because I can't test that now. Just look at model.xml "enable" attribute +
enable: ListItemData.enabled
08-21-2012 10:56 AM
Hi there,
In order to disable list items you have the correct code in your title:
enabled: false
However, items can still be selected, which conflicts with the API:
https://developer.blackberry.com/cascades/referenc
I would strongly recommend logging an issue for this one here:
https://www.blackberry.com/jira/secure/Dashboard.j
Thanks!
Martin