[TIMOB-720] changing objects/properties attached to a window does not work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2011-04-15T02:35:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Backlog |
Components | iOS |
Labels | ios, kroll |
Reporter | Nolan Wright |
Assignee | Jeff Haynie |
Created | 2011-04-15T02:35:05.000+0000 |
Updated | 2017-03-03T05:27:02.000+0000 |
Description
from premium ticket:
http://helpdesk.appcelerator.net/tickets/1768">http://helpdesk.appcelerator.net/tickets/1768
in app.js
var myObj = {};
myObj.prop1 = 'foo';
myObj.printValues = function()
{
Ti.API.info('values win1.myObj.prop1 ' + win1.myObj.prop1);
}
var win1 = Ti.UI.createWindow({
url: 'win1.js', })
win1.myObj = myObj;
win1.open();
in win1.js
var win = Ti.UI.currentWindow;
var openButton = Ti.UI.createButton({
title: 'foo Me' });
win.add(openButton);
openButton.addEventListener('click', function(e) {
win.myObj.printValues(); win.myObj.prop1 = 'bar'; win.myObj.printValues();
});
value of prop1 remains 'foo'
Dupe of #2392.
Closing issue due to time passed and irrelevance of the ticket.