Navgroup going to tabgroup and back

You must Login before you can answer or comment on any questions.

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

— asked 11 months ago by Terry O'Leary
2 Comments
  • Also, when I limit the SQLite Query LIMIT 0, 10 it works. Only trouble is that I need to display the 160 pins! 10 don't suit me at all.

    — commented 10 months ago by Nauris Pukis

  • Jesus. Wrong topic. Sorry :)

    — commented 10 months ago by Nauris Pukis

Your Answer

Think you can help? Login to answer this question!