Hi
I'm just starting out with this but I have create a single window app that uses a dashboard as the main window and from that you can visit other windows. I'm controlling the navigation using a navgroup and passing this with each window.
On one of my windows I want to have a TabGroup, which opens fine, I have a back button that should return the user to the dashboard when they are finished and at the moment the button event listener looks like this:
backBtn.addEventListener("click", function(){ tabGroup.close(); tabGroup = null; thisWin.navGroup.close(); });The window for the tabgroup is in an external js file compared to my app.js which is where the tab group has been constructed.
When I return to the dashboard I can click into another window but after about 10 seconds the app crashes and it doesn't really say why. I presume i might not be closing something or passing something I need too?
This is the code for my page in full:
var thisWin = Titanium.UI.currentWindow; var tabGroup = Ti.UI.createTabGroup(); //thisWin.backButtonTitle = 'Dashboard'; var backBtn = Ti.UI.createButton({ title:"Dashboard" }); var win1 = Ti.UI.createWindow({ title:"2012", }); win1.leftNavButton = backBtn; var win2 = Ti.UI.createWindow({ title:"2011" }); var win3 = Ti.UI.createWindow({ title:"2010" }); var tab1 = Titanium.UI.createTab({ title:'2012', window:win1 }); var tab2 = Titanium.UI.createTab({ title:'2011', window:win2 }); var tab3 = Titanium.UI.createTab({ title:'2010', window:win3 }); tabGroup.addTab(tab1); tabGroup.addTab(tab2); tabGroup.addTab(tab3); tabGroup.open(); backBtn.addEventListener("click", function(){ tabGroup.close(); tabGroup = null; thisWin.navGroup.close(); });Any pointers greatly recieved
Your Answer
Think you can help? Login to answer this question!