I have a view that gets data from my database, but on the window a call is made to a function to update the database with new values that are grabbed over the air from a webservice, however the view always loads with the old data first and I have to move out the window and back in the window to see the update!
I'm clearly doing something wrong so I'm wondering a few things:
1) should I somehow reload the scrollview once the database has updated (how would you do this)
2) do I just have the ordering in the file incorrect so the select is happening before the update??!
I think i'd rather go for option 1 and try to reload the window once I know the httpdClient has finished but no idea how to do the refresh.
For tableData, I wrap my row creation in a function I can call either as a callback or used in an event to update the dataset.
For multiple views, very similar, but you may have to remove all the children of a containing view, before re-adding the newly updated views.
You will get a different answer depending on 1. Your apps structure 2. the UI elements you wish to use
At first glance (without seeing your code), I can just point out that your are dealing with a synchronic (db) and an asynchronic (httpClient) function calls. Whatever code you are using to refresh the window has to be called again after the http completes. Certain views require that you remove them , recreate them and add them again to the window in order to see the changes. Again, it wouldn't be bad if you post some code ;-)
Think you can help? Login to answer this question!