Titanium Community Questions & Answer Archive

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

tabGroup open event


I want to add the event 'open' to my tabGroup. But when i add this nothing happens.

Anyone a solution for this?


— asked November 26th 2010 by Jacob van Dam
  • android
  • event
  • open
  • tabgroup
1 Comment
  • can you post some code?

    — commented November 26th 2010 by Aaron Saunders

2 Answers

  • Jacob

    Currently on android, there is no support for closing a tabgroup, so usually you would open it at the start of your app, as the root of all windows. Thus, probably the best workaround for you would be to listen to the focus event on the first window loaded by the tabgroup. If you add the windows after you open the tabgroup, then this should fire the events in the right sequence.

    — answered November 30th 2010 by Paul Dowsett
    • I don't want to close the tabgroup just want to have the open event triggered. A several days ago i created a ticket about this problem.

      — commented November 30th 2010 by Jacob van Dam
    • Jacob, I have simply suggested a workaround in the meantime, just in case it's useful. :)

      — commented November 30th 2010 by Paul Dowsett
    • i open tabgroup from one window in android but closing that tabgroup not baack to window but Close Appplication how to prevent close application …? in android

      — commented November 24th 2012 by Jayesh Joshi
  • an open on the tabGroup will fire when the group is open, which will in most cases only happen once when the app is launched.

    Is what you are looking for when a specific tab is opened? Then you can capture the "blur" event like this

    tabGroup.addEventListener('blur', function(e)
    Titanium.API.info(" tab index: " +e.index );
    Titanium.API.info(" prev index: " + e.previousIndex);
    — answered November 30th 2010 by Aaron Saunders
    1 Comment
    • Well.. I want to have this event fired when the tabGroup is openend and not after a user interaction.

      — commented November 30th 2010 by Jacob van Dam
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.