Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2154] Mobile Web: Titanium.UI.TabGroup.close() doesn't close the tab group

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2013-01-28T15:33:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterYaroslav Pidstryhach
AssigneeDavide Cassenti
Created2013-01-15T08:05:51.000+0000
Updated2016-03-08T07:41:08.000+0000

Description

Function [Titanium.UI.TabGroup.close()](http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.TabGroup-method-close) doesn't close the tab group and doesn't remove it from the UI. Example:
var wind = Titanium.UI.createWindow();	

var tabGroup = Titanium.UI.createTabGroup();

var redWin = Titanium.UI.createWindow({ backgroundColor: "red"});	

var baseUITab = Ti.UI.createTab({
    title: 'base_ui_title',
    window: redWin
});

tabGroup.addTab(baseUITab);

wind.add(tabGroup);

wind.addEventListener('postlayout',  function (){
    tabGroup.close();   // does nothing
});

wind.open();

Comments

  1. Davide Cassenti 2013-01-28

    Hello, You are never calling the tabGroup.open() method, so the tab group won't be closed; if you do something like this, everything will work:
       var tabGroup = Titanium.UI.createTabGroup();
       
       var redWin = Titanium.UI.createWindow({ backgroundColor: "red"});
       
       var baseUITab = Ti.UI.createTab({
           title: 'base_ui_title',
           window: redWin
       });
       
       tabGroup.addTab(baseUITab);
       
       tabGroup.addEventListener('postlayout',  function (){
           tabGroup.close();   // now it works
       });
       
       tabGroup.open();
       
  2. Yaroslav Pidstryhach 2013-01-28

    You are right, thank you.

JSON Source