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
Highlighted
New Developer
Posts: 2
Registered: ‎01-18-2014
My Device: Z10
My Carrier: Airtel India
Accepted Solution

How to access Page Properties from ListItemComponent in QML

Hi, 

 

I am new to BB10 development. I need help in the below mentioned problem (In Red)

 

    Page {

 

        id : page

 

        property Storage storage // this is a C++ class registered to be accessed from QML pages

 

        Container{

 

             ListView {

 

                listItemComponents: ListItemComponent {

 

                    CustomListItem {

 

                                 ImageButton {

 

                                      text: "Save"

                                      onClicked: {

 

                                        storage.save() 

                                       // I am not able to get the reference of the storage property defined in Page. It is always [NULL], i get the reference fine outside the ListView

                                       

                                 }}}}}}

 

 

PS : I have only provided the necessary code

 

New Developer
Posts: 2
Registered: ‎01-18-2014
My Device: Z10
My Carrier: Airtel India

Re: How to access Page Properties from ListItemComponent in QML

I got the solution

 

added CustomListItem id as 

 

id: customCell

 

now

 

customCell.ListView.view.parent.parent.storage