I have data being passed from a SQLite database to a webview. The webview safe itself loads with the HTML and CSS, but the data doesn't. But, if I go back to the table and click the row it will load, and works fine after that. If I close the app down, and go out of the app, the process will repeat. How do I get the data to load into the webview on the first click?
1 Answer
Try increasing the timeout before you send your Ti.App.fireEvent(webPageReady... event.
Set this to something massive, say 5000 ms and if your webview always updates, it would seem to imply you're firing the event before your webview has loaded.
If that works, refactor your code, firing the event from within a "loaded" event listener attached to your webview.
i.e. something like
web.addEventListener('load', function (e) { Ti.App.fireEvent("webPageReady", { name : name, pwidth : pwidth, pheight : pheight, pcolor : pcolor, qty : qty, pcolor1 : pcolor1, qty1 : qty1, pcolor2 : pcolor2, productID : productID, }); }
Your Answer
Think you can help? Login to answer this question!