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.

Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

access list item component outside listview


I would like to know if it is possible to access a list item component outside the listview.


In my case, I have a  label and a checkbox in the listview. I have another button outside the listview. When I press this button, I should show a pop up or say, a system dialog with the label text in the listview.  


I also need to uncheck the checkbox in the listview when this outside button is pressed. I tried this way.. gave a id for the chckbox and declared it as Qt.myCheckBox. And then accessed this one inside the onTriggered event of the outside button. but that dint work. 


Any solution would be really appreciated..  Urgently needed.


Thanks ..

Please like this if you are answered.
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: access list item component outside listview

[ Edited ]

It's not possible because ListItemComponents can be reused for different dataModel items, so their existence is not guaranteed.


The preferred way to change ListItemComponent is to update the item in model with the new data.


You can also bind controls inside of ListItemComponents to a property outside. You'll need a proxy function defined in ListView{} to access outer controls. For example (pseudocode):

property bool checkboxValue

ListView {
listItemComponents: [ ListItemComponent { id: root SomeOtherComponent {
someField: root.ListItem.view.checkboxValueProxy() }
} ] function checkboxValueProxy() { return checkboxValue } }


upd:  methods for updating the model are named differently depending on datamodel type. Some sample code:


ListItemComponents will be refreshed automatically when model items are updated.


Andrey Fidrya, @zmeyc on twitter
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Re: access list item component outside listview

Thank You. How do I bind controls inside of listItemComponents to a property outside? I did not quite understand it.


Also, how can I update the item model? Would be really helpful if you could point me to some code example.


Thanks again..

Please like this if you are answered.