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
andrewsmiley
Posts: 26
Registered: ‎07-22-2014
My Device: Z30, Z10, Q10, Passport

ListView not refreshing

[ Edited ]

In my app I am updating the data model's source when a button is clicked and then reloading the model to (hopefully) uypdate the listview. 

 

                        scoreboardCalViewDataModel.clear();

                        scoreboardCalViewDataModel.append(data);

 

This works the first time you use it and shows the date properly.  Oddly, it also works if you leave the app running for a few minutes and try the button again.  If you click it again right away the source updates but it still shows the content from the original source. I know the source is updated because it shows the correct one in the console log. 

 

From the console: 

scoreboard listview dataModel size: 1  <- scheduleDataModel.size() before .clear()

scoreboard listview dataModel size: 0 <- after .clear()

scoreboard listview dataModel size: 0 <- after .load()

from scoreboard ondataloaded: http://api.example.com/admin/example.aspx?<- this is correct and returns the right data

appId=XXXXX&gameId=XXXXXXXX

 

The part that really confuses me is the way it will work if you give it enough time in between clicks.  Is there a way to tell the listview to break the cache and refresh right away (???) or something along those lines?