How to reload window?
Hi, I have a window and would like to create a button. This button is to reload the current window once it is clicked. May I know how can I reload the content of current window?
Ti 1.6.1, Android 2.2
1 Answer
-
I haven't worked a whole lot with HTTPClient, but from what I've read you should just be able to call the loader.send() method in your button's 'click' event listener. Whenever you receive the information you've requested the loader.onload() method will be called, so make sure to define it before you send the request.
In the loader.onload() method you can use the tableView.updateRow method or tableView.insertRowAfter and table.remove to update your table. There is also a tableView.setData method.
The docs for tableView and HTTPclient:
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableView-object.html
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Network.HTTPClient-object.html