Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4216] window doesn't assign custom functions

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-05-25T07:37:52.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsios
ReporterSimon Lipke
AssigneeReggie Seagraves
Created2011-05-17T09:43:28.000+0000
Updated2017-03-31T17:27:23.000+0000

Description

After creating a new window and opening it, functions assigned to the window can't be accessed. Properties just work normal, this issue is since 1.7.0.RC1, 1.6.2 worked just fine. Example:
var win = Titanium.UI.createWindow({
	url: 'foo.js',
	title: 'Foo',
	customFunction: function() {
		alert('Test');
	},
	customProperty: 'Property'
});

win.open();
var currentWindow = Titanium.UI.currentWindow;

Ti.API.info('currentWindow.customProperty = ' + currentWindow.customProperty);
Ti.API.info('currentWindow.customFunction = ' + currentWindow.customFunction);


Prints out the result on 1.7.0.RC1 and iOS Simulator 4.2:

[INFO] currentWindow.customProperty = Property
[INFO] currentWindow.customFunction = undefined

but should be (on 1.6.2 and iOS Simulator 4.2):

[INFO] currentWindow.customProperty = Property
[INFO] currentWindow.customFunction = function () {
	alert('Test');
}

Comments

  1. Simon Lipke 2011-05-20

    Seems to be fixed in latest builds, thx
  2. Lee Morris 2017-03-31

    Closing ticket as I am unable to reproduce the issue using the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source