{ "id": "61547", "key": "TIMOB-915", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:39.000+0000", "created": "2011-04-15T02:39:07.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "context", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:39.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
If you create a window like so:
\n\nvar myObject = { doSomething: function() { Ti.API.info(\"hello world\"); } }\nvar window = Ti.UI.createWindow({\n url: 'window.js',\n myObject: myObject\n});\nwindow.open();
\n
\nYou can't access \"myObject\" from within the Window's context,\nlike so:
\n// window.js\nvar win = Ti.UI.currentWindow;\nvar myObject = win.myObject;\nmyObject.doSomething();
\n
How can we work around this until it is fixed?
What's the complexity of this issue? If it's something that can\nbe fixed without ripping apart and putting back together a good\nchunk of the current codebase, I'm willing to dive into it as I'd\nreally like to have this issue resolved.
Just a clarification: I think the title here is a bit misleading\n(or the situation has changed since May). In the example,\nmyObject
is indeed accessible in the second context.\nIt's just that we don't (but will as soon as I push a fix) support\ncalling functions that are properties of that object. If you have a\nsimple string property in myObject
, for example, you\ncan read that string in the second context.
(from [22a8b9af67d67aaaa105bb146f8223fbdc2fbab1])\n[#915\nstate:fixed-in-qa] Support functions (KrollCallbacks) in random\ndata (custom properties, etc.) put on a proxy. \nhttp://github.com/appcelerator/titanium_mobile/commit/22a8b9af67d67...
confirmed against 1.4.1.3f9cdc, android and iOS