Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8047] MobileWeb: TableView - Creating table view rows (~200) in a for loop caused a error "Javascript execution exceeded timeout"

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2012-03-15T15:19:29.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsMobileWeb
Labels"qe-mw020912"
ReporterMichael Pettiford
AssigneeChris Barber
Created2012-03-15T15:13:12.000+0000
Updated2014-01-28T23:48:59.000+0000

Description

Steps to reproduce: 1. Create a default mobile web app and change the app.js code to the following:
var _window = Titanium.UI.createWindow({
			title : 'test',
			backgroundColor : 'white'
		});
var rows = [];
		
		for(var i = 0; i < 200; i++) 
		{
			var row = Ti.UI.createTableViewRow({
				className:'row'
			});
			
			row.add(Ti.UI.createLabel({
				text : 'Row ' + i,
				left : 70
			}));
			
			row.add(Ti.UI.createImageView({
				image : 'iproducts.png',
				left : 10
			}));
			
			rows.push(row);
			
			row = null;
		}
		
		_window.add(Ti.UI.createTableView({
			data : rows,
			bottom : 50
		}));
_window.open();
2. Run the app on *device* (this issue did not occur on desktop) Actual result: The following error is output to the console "Javascript execution exceeded timeout" Expected result: The table view is created and added to the window

Comments

  1. Bryan Hughes 2012-03-15

    Problem is caused by a brute-force implementation of tableview. Ticket TIMOB-7342 has been filed to fix this issue. On some browsers, once you recieve this error, you will continually recieve this error until you force quit the browser (especially true on iOS devices). To force quit safari, long press the home button, long press the safari icon that pops up, and click the red x.

JSON Source