Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3798] proxies fail to retain (in terms of scoping) properties set at creation

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-05-13T16:32:04.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sRelease 1.7.0, Sprint 2011-17
ComponentsiOS
Labelsios, ios_proxy_registration
ReporterBlain Hamon
AssigneeBlain Hamon
Created2011-04-27T18:28:51.000+0000
Updated2011-05-13T16:32:04.000+0000

Description

Credit goes to Shannon Hicks of Pintley ======= Blain, Here's a bit of my code:
pintley.ui.screens.createLeaderboardTab = function(_data,_returnView) {
	var leaderboardWindow = Titanium.UI.createWindow($$.Window);
	
	pointsData = _data;
	tableData = [];
	tableRows = [];
	
	// display objects
	tableView = Titanium.UI.createTableView({
		data:tableRows,
		backgroundColor:'white'
	});
	
	leaderboardWindow.add(tableView);
	
	// when this window is shown, get some data
	leaderboardWindow.addEventListener('open',function(){
		alert('you opened this tab');
	});

	var tab = Titanium.UI.createTab({
		icon:'images/tab_friends.png',
		title:'Leaderboard',
		window:leaderboardWindow
	});
	
	return tab;
};

When this code is the second Tab in a TabGroup, upon switching to the tab, sometimes the "open" event fires, but most of the time it doesn't. Hope this helps.

Comments

  1. Blain Hamon 2011-04-27

    Fixed this by changing setValuesForKeysWithDictionary (Which IS a path traversed by proxy creation) to handle JS ownership for us.
  2. Jacob Relkin 2011-05-13

    Verified fixed. (1_7_X, e6afca8..., iOS Simulator and Verizon iPhone 4 device.)

JSON Source