[TIMOB-4217] Window doesn't assign custom functions
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2017-06-05T21:33:36.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android |
| Labels | n/a |
| Reporter | Paul Dowsett |
| Assignee | Ingo Muschenetz |
| Created | 2011-05-25T07:38:19.000+0000 |
| Updated | 2017-06-05T21:33:36.000+0000 |
Description
After creating a new window and opening it, functions assigned to the window return undefined. Properties work as expected.
Example:
var win = Titanium.UI.createWindow({
url: 'foo.js',
title: 'Foo',
customFunction: function() {
Ti.API.info("customFunction executed!");
},
customProperty: 'Property returned!'
});
win.open();
var currentWindow = Titanium.UI.currentWindow;
Ti.API.info('currentWindow.customFunction() = ' + currentWindow.customFunction());
Ti.API.info('currentWindow.customProperty = ' + currentWindow.customProperty);
KrollContext D (kroll$1: app://app.js) [199,480] Running evaluated script: file:///android_asset/Resources/app.js
KrollContext D (kroll$2: app://foo.js) [205,685] Running evaluated script: app://foo.js
TiAPI I (kroll$2: app://foo.js) [16,701] customFunction executed!
TiAPI I (kroll$2: app://foo.js) [1,702] currentWindow.customFunction() = undefined
TiAPI I (kroll$2: app://foo.js) [5,707] currentWindow.customProperty = Property returned!
Closing ticket due to time passed and lack of progress over the past few years.