Titanium Community Questions & Answer Archive

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

Return to and update underlying window/tableview

Hi (again) :)

Got a new question for the experts :)

I've got a tabbed app with 2 tabs. The first one is the interesting one. Here you're presented with a tableview, you can click through to yet another tableview and from here to a "details" view.

So something like this:

Root of tab (tableview, list of items)
-> List of subitems (tableview)
–> Details view

I would like to know two things:

  1. How do I go directly from the details view to the root table view (skipping the middle subitems view/window)?

  2. How do I refresh the data in the root tableview triggered by an action in the detail view? Let's say a click of the button on the detail view adds an item/row to the root table view.

I hope you can help me out - I didn't find anything related to this in the KitchenSink app :(

— asked April 28th 2010 by Simon Westh Henriksen
  • tableview
  • window

4 Answers

    1. Normally when an app goes back to the root panel it wants to close everything (windows/views) it has open. One way to do it is to keep track of the window/view hierarchy you have open (by using custom properties whenever you open a new window/view). Then when you are in your details view you can close all intermediate windows and/or remove opened views by calling their corresponding close() or remove() APIs. Alternatively you can try to hide those windows/views if you need to go back and don't want to recreate those objects.

    2. One way to do it is to pass the parent tableview info when you open you detail view then when you want to update the parent tableview you can its APIs (such as appendRow())

    — answered April 28th 2010 by Kyle Quest
  • Hi Kyle,

    Thanks for your answer.

    I'm working on #2 and I've been able to use both setData and insertRowBefore with the same result. The new rows is added and displays fine. But their properties is undefined (tried Ti.API.info(e.rowData.title)) and when you scroll in the tableview, the entries becomes blank.

    Do you have any idea about what could be causing this?

    Thanks in advance.

    — answered April 28th 2010 by Simon Westh Henriksen
  • hi, look like im facing same #2 problem. i need to change my root's properties and i didn't understand your explanation. could you attach some sample code please?

    Thanks in advance


    — answered August 9th 2011 by Wilson Wijaya
  • Hey guys…I've had this type of issue a lot as well. I've solved it by using app wide event listeners. You set the listener in the underlying view, then fire it in the detail view.

    — answered August 11th 2011 by Duncan Mapes
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.