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: 91
Registered: ‎09-25-2012
My Device: bb10 alpha
My Carrier: free

How to refresh my async model from a ListView scrolled ?

Hello,

 

I just read this documentation : https://developer.blackberry.com/cascades/documentation/ui/lists/asynch_data.html

And I m trying to implement the solution #1. 

So, I m looking for a signal from ListView to inform my model to append datas ? But I didn't find it... 

Maybe, there is a virtual method from the model ? 

 

Could you help me ? 

a lover of Qt
Highlighted
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: How to refresh my async model from a ListView scrolled ?

There are no signals or methods to tell you that the list hit the end. You would have to come up with another solution to either watch the scroll position or see which items are rendered and decide if you then need to load more
Like all of my posts
Developer
Posts: 54
Registered: ‎05-23-2012
My Device: Developer
My Carrier: Developer

Re: How to refresh my async model from a ListView scrolled ?

[ Edited ]

"watch the scroll position or see which items are rendered"

 

Can you elaborate on how you'd do this?

 

The only idea I've come up with so far is implementing my own ListItemProvider so I can override updateItem() myself. The Asynchronous data providing sample code doesn't actually demonstrate how to detect when to load / unload data. 

 

My list needs to scroll through ~25MB of data.

----
I know exactly where the problem *might* be.
Developer
Posts: 54
Registered: ‎05-23-2012
My Device: Developer
My Carrier: Developer

Re: How to refresh my async model from a ListView scrolled ?

[ Edited ]

I think this is the solution: http://supportforums.blackberry.com/t5/Cascades-Development/Listview-question/m-p/2103171/thread-id/...

 

Using a ListScrollStateHandler or overriding DataModel::data() 

----
I know exactly where the problem *might* be.