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 ?
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?
-
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 ?
-
Sorry, when I actualized the page, this one resend my post…
-
Sorry, when I actualized the page, this one resend my post… Twice
-
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.
-
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 !
-
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