If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer
Accepted Solution

How do I load more records into ListView when you get to the end.

Hi,

 

I'm trying to append more records to the end of my listview as the user gets to the end..  from the research I've done this is what I have come up with...  and it works but the problem is that each time I get to the end and I load more records the records appear before my current positon in the listview because the moment it loads more data into the list I get pushed to the bottom of the listview,  how do I hold the position of where I am in the listview so that more records are added to the bottom of it...

 

i

ListView {
                id: searchListView
                dataModel: searchDataModel
                listItemComponents: [
                    ListItemComponent {
                        type: "item"
                        SearchResultsListItem {
                            title: ListItemData.Title
                        }
                    }
                ]
attachedObjects: [
                    // This handler is tracking the scroll state of the ListView.
                    ListScrollStateHandler {
                        id: scrollStateHandler

                        onScrollingChanged: {
                            if(atEnd)
                            {
                                console.log("List View at end needs more data: ");
                                console.log("firstVisibleItem: " + firstVisibleItem );
                                // load more data


                            }
                        }
                    }
                ]
)

 

 



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
madkristoff
Posts: 58
Registered: ‎11-30-2012
My Device: BlackBerry Z10
My Carrier: Telus

Re: How do I load more records into ListView when you get to the end.

I'm not too sure and it is impossible to tell from your code, but my guess is the sorting method you are using does it. If not, how are you loading items into the list? You basically want to append them to the end right?
__________________________________________________________

If my post helped, click the like button!

Developer of Reader|YC , an open source Hackernews client
Please use plain text.
Developer
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer

Re: How do I load more records into ListView when you get to the end.

Exactly thank you...


GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.