Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10380] MobileWeb: TabGroup: addTab results in Uncaught TypeError: Cannot read property of 'rightNavButton of undefined'

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-09T17:47:19.000+0000
Affected Version/sRelease 2.1.1, Release 2.1.2
Fix Version/sRelease 3.0.1, Release 3.1.0, 2013 Sprint 01 JS, 2013 Sprint 01
ComponentsMobileWeb
Labelsapi, qe-mia, qe-mw082012, regression
ReporterDustin Hyde
AssigneeBryan Hughes
Created2012-08-09T22:33:41.000+0000
Updated2013-02-09T00:13:55.000+0000

Description

TabGroup.addTab results in Uncaught TypeError: Cannot read property of 'rightNavButton of undefined'. Screenshot attached. This is a regression. This does not occur in Titanium SDK 2.1.0. This does not occur in iOS. Steps to Reproduce: 1. Run code:
var mainTabGroup = Ti.UI.createTabGroup();

var mainTab1 = Ti.UI.createTab({
	backgroundColor : 'green'
});

mainTabGroup.addTab(mainTab1);

var mainTab2 = Ti.UI.createTab({
	backgroundColor : 'red'
});

mainTabGroup.addTab(mainTab2);

mainTabGroup.open();
Actual Result: TypeError. Expected Result: Two tabs.

Attachments

FileDateSize
addTab.png2012-08-09T22:33:41.000+0000165896

Comments

  1. Eric Merriman 2012-08-10

    I was able to run without problem when creating a window for each tab then specifying the windows during tab creation with "window:win1" and "window:win2".
  2. Eric Merriman 2012-08-10

    Here is a modified sample that works with "mobileweb - preview in browser", "mobileweb - preview in emulator" and on iOS.
       var mainTabGroup = Ti.UI.createTabGroup();
       
       var win1 = Ti.UI.createWindow({
       	backgroundColor:'white'
       });
       
       var mainTab1 = Ti.UI.createTab({
           window:win1
       });
       
       var win2 = Ti.UI.createWindow({
       	backgroundColor:'red'
       });
        
       var mainTab2 = Ti.UI.createTab({
           window:win2
       });
       
        
       mainTabGroup.addTab(mainTab1);
       mainTabGroup.addTab(mainTab2);
        
       mainTabGroup.open();
       
  3. Lokesh Choudhary 2012-08-10

    Verified the issue exists on : Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120809153311 , 2.1.1 GA Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 6,firefox 14. 1.It is seen only when we do not create a window for each tab & then specifying it — as mentioned by Eric in the bug. 2.Yes it is a regression . It does not happen on 2.1.0 GA.
  4. Bryan Hughes 2013-01-08

    PR: https://github.com/appcelerator/titanium_mobile/pull/3682
  5. Bryan Hughes 2013-01-08

    3_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/3683
  6. Lokesh Choudhary 2013-02-09

    Verified the fix.getting two tabs one green & other red. Thus closing the issue. Environment: Ti Studio : 3.0.2.201302041757 Ti BB SDK : 3.0.2.v20130207164659 Mac OSX : 10.8.2 CLI Version : 3.0.24-cr

JSON Source