Titanium Community Questions & Answer Archive

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

Changing Window Content within a Navigation Group

I'm using a navigationGroup, and on one window the user has the option to toggle between multiple ways that the data on the window is displayed. So, when a button is clicked I need to change the content in the window without changing my "position" in the navgroup.

I'm thinking the best way to do this will be to write routines to remove the old UI elements and replace them with the new ones, but I was wondering if there was an easier way. Say, to replace the current window entirely, without messing up the navGroup… or to change the url property of the current window and somehow get it to refresh itself (changing the url by itself does nothing).

Any ideas?

— asked December 2nd 2010 by John Williams
  • iphone
  • navigationgroup
0 Comments

3 Answers

  • you might want to try putting a tab group inside of the navigation group… as the user clicks the button, just insert a new Tab with the new window. Then delete the original Tab.

    I have never tried this… it is just an idea

    — answered December 2nd 2010 by Aaron Saunders
    permalink
    0 Comments
  • That was a good idea, but unfortunately doesn't work. The navgroup adds all the pages in the tabgroup to itself in series and you can't even see the tabs.

    I think I'll just create two different views and a toolbar with a button. When the button is clicked, I'll swap out the views. …not sure if I can get a transition effect on the views (that would be cool) but it's still a fairly straightforward solution.

    Thanks!

    — answered December 2nd 2010 by John Williams
    permalink
    0 Comments
  • I think it actually does work… take a look at the code and let me know if you have questions. I did not write it all up, but I validated that the windows belong to the TabGroup not the Navigation Group, and you can toggle through the windows

    here is code http://pastie.org/1350436 that has a TabGroup in a Navigation Group with multiple windows owned by the TabGroup

    — answered December 5th 2010 by Aaron Saunders
    permalink
    0 Comments
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.