Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-720] changing objects/properties attached to a window does not work

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2011-04-15T02:35:06.000+0000
Affected Version/sn/a
Fix Version/sBacklog
ComponentsiOS
Labelsios, kroll
ReporterNolan Wright
AssigneeJeff Haynie
Created2011-04-15T02:35:05.000+0000
Updated2017-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'

Comments

  1. Stephen Tramer 2011-04-15

    Dupe of #2392.

  2. Lee Morris 2017-03-03

    Closing issue due to time passed and irrelevance of the ticket.

JSON Source