Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10401] MobileWeb: Tab: window property not respected post-initialization

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-26T22:12:29.000+0000
Affected Version/sRelease 2.1.0, Release 2.1.1, Release 2.1.2
Fix Version/sn/a
ComponentsMobileWeb
Labelsapi, parity, qe-mw082012
ReporterDustin Hyde
AssigneeEric Merriman
Created2012-08-10T14:18:09.000+0000
Updated2017-08-24T20:53:03.000+0000

Description

Ti.UI.Tab.window and setWindow are not respected. Uncaught TypeError: Object [object TiUITab] has no method 'setWindow' This is not a regression. This works on iOS and Android. Steps to Reproduce: 1. Run code:
var mainTabGroup = Ti.UI.createTabGroup();

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

var mainWin1 = Ti.UI.createWindow({
	backgroundColor : 'yellow'
});

mainTab1.window = mainWin1; // ignored
// mainTab1.setWindow(mainWin1); // runtime error

mainTabGroup.addTab(mainTab1);

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

var mainWin2 = Ti.UI.createWindow({
	backgroundColor : 'blue'
});

// mainTab2.window = mainWin2; // ignored
mainTab2.setWindow(mainWin2); // runtime error

mainTabGroup.addTab(mainTab2);

mainTabGroup.open();
Actual Result: window property is ignored or setWindow method generates runtime error Expected Result: A tab group should open with colored tabs and colored windows.

Comments

  1. Dustin Hyde 2012-08-10

    Note: windows do work at tab initialization. Here is sample work-around code:
       var mainTabGroup = Ti.UI.createTabGroup();
       
       var mainWin1 = Ti.UI.createWindow({
       	backgroundColor : 'yellow'
       });
       
       var mainTab1 = Ti.UI.createTab({
       	backgroundColor : 'green',
       	window : mainWin1
       });
       
       mainTabGroup.addTab(mainTab1);
       
       var mainWin2 = Ti.UI.createWindow({
       	backgroundColor : 'blue'
       });
       
       var mainTab2 = Ti.UI.createTab({
       	backgroundColor : 'red',
       	window : mainWin2
       });
       
       mainTabGroup.addTab(mainTab2);
       
       mainTabGroup.open(); 
       
  2. Ketan Majmudar 2013-07-03

    This problem still exists, and now using alloy, I can not set the contents of the Window, unless its in my XML markup, I'm pretty sure this problem still exists. eg, I can not set the window property of the tab to a [TiUIWindow] object - which works on both iOS and Android, in some instances I have to use the tab.setWindow method (which results in an error on Mobile Web)
  3. Lee Morris 2017-08-24

    Mobile Web has been deprecated and will be removed in fixVersion 7.0.0.

JSON Source