Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4217] Window doesn't assign custom functions

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-05T21:33:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterPaul Dowsett
AssigneeIngo Muschenetz
Created2011-05-25T07:38:19.000+0000
Updated2017-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!

Comments

  1. Lee Morris 2017-06-05

    Closing ticket due to time passed and lack of progress over the past few years.

JSON Source