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: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free
Accepted Solution

ListView recycling

Hi!

 

The ListView  seems to have a recycle system when scrolling

 

It has drawback, for exemple, if I have a checkbox on a cell, it is sometime already checked whereas I specifically set "checked=false" in the QML.

So it means that when the webview reuse a old cell, it sets all the data that depends of the DataModel, but not the default values.

 

Is this assumption true?

Do we have a signal or a workaround to reset default values of the cell?

 

Thanks

Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: ListView recycling

I use an ImageToggleButton and set my checked:true.  I've had no issues of it not working.  I've had many issues with it recycling images but haven't had any issues with the toggle button.

---
If you find my post helpful please "like" it and "accept as a solution"
Highlighted
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: ListView recycling

What are you using a webview for? You need to make sure the properties of the items have a reset property and a notify property so that when the new data is set on the cell that the qml rebinds.
Like all of my posts
Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: ListView recycling

I finally created the checkbox property to make it bind to the ListItem, even if it has no meaning for the data.

Developer
Posts: 54
Registered: ‎05-23-2012
My Device: Developer
My Carrier: Developer

Re: ListView recycling

@

 

I'm having issues with ListView recycling ImageViews as well. Did you find a workaround?

----
I know exactly where the problem *might* be.
Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: ListView recycling

Could you open a post (and provide a link to it) which describe exactly the problem your are facing?

 

Developer
Posts: 293
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: ListView recycling

Try using property binding, rather than javascript assignments

Developer
Posts: 54
Registered: ‎05-23-2012
My Device: Developer
My Carrier: Developer

Re: ListView recycling

I solved it with a bit of a hack/workaround here: http://supportforums.blackberry.com/t5/Cascades-Development/How-to-detect-when-ListView-recycles-an-...

----
I know exactly where the problem *might* be.
Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: ListView recycling

Update, use this:

 

ListItem.onDataChanged: {

 

}