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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


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