Titanium Community Questions & Answer Archive

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

Change the Window of a Tab

Hello there !

I'm french so sorry for my poor english.

I have a tabgroup and for each tab in this one, I declare (like I must I think) a window, like this :

    var myTab = Titanium.UI.createTab
    ({
        icon:'img.png',
        title:'MyTab1',
        window:win1
    });

Win1 contains a lot of info so to not reorganize it or destroy and recreate, I would like to hide it (this works) and to open another window in myTab… I try to change the window property of the tab, then open my window… but nothing which runs… !

Any Ideas ?

— asked July 30th 2010 by Antoine Vigneau
  • iphone
  • tab
  • tabgroup
  • window
0 Comments

7 Answers

  • Accepted Answer

    You could try to open the second window using

    myTab.open(the_second_window,{animated:true});
    

    This will give you a nice navigation bar with a back button to the win1.

    This is what you want?

    — answered July 30th 2010 by Dan Tamas
    permalink
    0 Comments
  • Yes, this could be what I want but… I try it and it's not working… I think that the tab cannot be modified, I try a simple : myTab.title = 'Another Title'; : Fail !
    And your code fails too !

    Anybody have already done this ?

    — answered August 2nd 2010 by Antoine Vigneau
    permalink
    0 Comments
  • Sorry, when I actualized the page, this one resend my post…

    — answered August 2nd 2010 by Antoine Vigneau
    permalink
    0 Comments
  • Sorry, when I actualized the page, this one resend my post… Twice

    — answered August 2nd 2010 by Antoine Vigneau
    permalink
    0 Comments
  • Tamas' code should work, as should myTab.title = 'New Title'. When you said it fails - what happens, do you get an error message?

    Check that the myTab variable is not out of scope when you refer to it.

    — answered August 2nd 2010 by Goran Skledar
    permalink
    0 Comments
  • Oh Bingo ! My var was not visible ! But like I had no errors, I didn't think to this !
    So Tamas's code works perfectly, and the title changement too !

    Thanks guys !

    — answered August 2nd 2010 by Antoine Vigneau
    permalink
    0 Comments
  • By the way, I tried it too and it works. That is also what I was looking for.
    Soooo simple when you know it.

    Thanks a lot

    — answered September 21st 2011 by Nicolas Bouillon
    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.