Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 222
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline
Accepted Solution

enabled: false in StandardListItem (bug or not?)

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?

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: enabled: false in StandardListItem (bug or not?)

After some quick tests I think I'm seeing the same thing as you.

Do you have a small bit of sample QML?

 

Stuart

Developer
Posts: 222
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: enabled: false in StandardListItem (bug or not?)

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
Highlighted
Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: enabled: false in StandardListItem (bug or not?)

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/reference/bb__cascades__control.html#enabled

 

I would strongly recommend logging an issue for this one here:

https://www.blackberry.com/jira/secure/Dashboard.jspa

 

Thanks!

 

Martin