Titanium Community Questions & Answer Archive

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

Opening a different initial tab on tabGroup.open

Hi, quick question on opening a tab group: I have an option dialog on the initial page load to either login or create an account; when you click on either button, it loads a tab group.

What I'd like to do is open that tab group with the second tab showing initially if you click the second button. The following code segments do NOT do this, and I'm not sure what else to try.

Note: I assign tabs to that tabGroupLogin after it, I just removed it for brevity. e.index is the option dialog button the user clicks.

var tabGroupLogin = Ti.UI.createTabGroup();

// always loads the first tab initially
tabGroupLogin.open({
    activeTab:e.index
});

// always loads the first tab initially
tabGroupLogin.setActiveTab(e.index).open();

// always loads the first tab initially
tabGroupLogin.open().setActiveTab(e.index);

// also always loads the first tab initially
tabGroupLogin.open();
win.tabGroup.setActiveTab(e.index); // doesn't matter if this goes before or after open()

If anyone has any ideas on how to open a tab group so that a tab other than the first one is shown at first, I'd really appreciate it.

Thanks!

— asked March 15th 2010 by Andrew Gioia
  • activetab
  • group
  • setactivetab
  • tab
  • tabgroup
0 Comments

1 Answer

  • Accepted Answer

    it's a bug. we have a ticket in lighthouse around this.

    https://appcelerator.lighthouseapp.com/projects/32238/tickets/495-setting-active-tab-does-not-work-on-app-startup

    — answered March 16th 2010 by Nolan Wright
    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.