Refreshing Tableview in a Splitview App

You must Login before you can answer or comment on any questions.

Hi, i am doing a Splitview App for Ipad, i have to refresh my tableview in my masterview each time the user clicks on a button (this button is in another window), how can i do? thanks

2 Answers

Accepted Answer

You can add Application event for executing code from another window. for example :

Ti.App.addEventListener("customEvent",function(e){
    // Do process.
});
Fire event from your window where button placed in split view.
Ti.App.addEventListener("customEvent");
Remember one thing, the Event Listener should be added only once in whole execution of Application.

— answered 1 year ago by Gaurang Chhatbar
answer permalink
2 Comments
  • it gives me an error when i call Ti.App.addEventListener("customEvent");

    — commented 1 year ago by Raffaele Chiocca

  • oh sorry Raffaele,

    It my mistake, Its

    Ti.App.fireEvent("customEvent");
    instead of
    Ti.App.addEventListener("customEvent");

    — commented 1 year ago by Gaurang Chhatbar

First of all you need to fire the event in the click-event of the button:

Ti.App.fireEvent("updateTable", {
    newData: [{title: 'New Data1'},{title: 'New Data 2'}]   
}
and then listen to the fired event in the TableView:
Ti.App.addEventListener("updateTable",function(e){
    tableView.setData([e.newData]
});

— answered 1 year ago by Hans Knoechel
answer permalink
6 Comments
  • my problem is that when i had initialized my tableview in the master window (MASTER_WINDOW.init) the tableview remains static, i can't reload

    — commented 1 year ago by Raffaele Chiocca

  • Do you have a code-snippet?

    — commented 1 year ago by Hans Knoechel

  • how can i give you my code-snippet? (e-mail or other?)

    — commented 1 year ago by Raffaele Chiocca

  • Show 3 more comments

Your Answer

This question has been locked and cannot accept new answers.