Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Refresh Picker Data.

Hi. I'm REALLY struggling w/ refreshing picker data. My pickers are populated from a SQLite DB.

The pickers get created and populated when the application loads. Via a load function. Here is a sample on load function: <script src='http://pastie.org/1243479.js'></script>

After the user connects to the database, I wish to refresh the pickers with potentially new data. Here is my reload function: <script src='http://pastie.org/1243480.js'></script>

This function is called after I update my local sqlite DB. If I shut down the application and start again, my new data is there. But, otherwise, it is not.

I have tried…

reloadColumn (crash)
reloading an empty array into the picker and then reload w/ data (crash)

I can just do an add - and it will add all the data AGAIN, so then I have duplicate entries.

Any help is MUCH appreciated.

Thanks.

Jennifer

— asked October 23rd 2010 by Jennifer Bonnett
  • iphone
  • picker
  • refresh/reload
  • sqlite
0 Comments

1 Answer

  • The add method appends data to the picker, it does not replace it. There is a method in the iOS implementation that is called remove but it has no code so it is essentially useless right now. From what I can see in the picker there is nothing present that would allow you to replace data.

    At this time I think you only thing you can do is replace the picker, not just reload it. I know it's not the answer you probably wanted.

    — answered October 23rd 2010 by John McKnight
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.