Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10916] Android: TabGroup - tabGroup.activeTab returns null instead of object

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-18T13:43:39.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-19 API, 2012 Sprint 19
ComponentsAndroid
Labelsapi, module_tabgroup, qe-review, qe-testadded, regression
ReporterAnshu Mittal
AssigneeHieu Pham
Created2012-09-14T04:30:39.000+0000
Updated2014-01-23T18:07:57.000+0000

Description

tabGroup.activeTab returns null instead of object. This is regression since the issue does not occur on 2.1.2 GA. Steps to reproduce: 1. Create an app using the code below. 2. Launch the app. and check logs. Expected: Activetab should return object. Actual: Activetab returns null.

var win1 = Ti.UI.createWindow({
    title: 'Win 1'
});

var button = Ti.UI.createButton({
    color: '#000',
    style: Ti.UI.iPhone.SystemButtonStyle.BORDERED,
    title: 'Set Active Tab 1'
});
 
button.addEventListener('click', function(e) {
    tabGroup.setActiveTab(1);
    Ti.API.info('****************** activeTab: ' + tabGroup.activeTab);
});
 
win1.add(button);
 
var tab1 = Ti.UI.createTab({  
    icon: 'KS_nav_ui.png',
    title: 'Tab 1',
    window: win1
});
 
var win2 = Ti.UI.createWindow({
    title: 'Win 2'
});
 
var tab2 = Ti.UI.createTab({  
    icon: 'KS_nav_views.png',
    title: 'Tab 2',
    window: win2
});

var tabGroup = Ti.UI.createTabGroup({
	
});
         
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
 
tabGroup.open();
 
Ti.API.info('********************* activeTab: ' + tabGroup.activeTab);

Comments

  1. Ping Wang 2012-09-15

    This issue only happens on master. 2_1_X works fine. It is probably caused by this [PR](https://github.com/appcelerator/titanium_mobile/pull/2794). Removed "merge-2.1.3" from Labels.
  2. Anshu Mittal 2012-10-24

    Tested with: SDK:3.0.0.v20121019153308 Studio: 3.0.0.201210141844 Device: LG-p970(Android 2.2.2) tabGroup.activeTab returns object
  3. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5074

JSON Source