[TIMOB-915] Custom proxy data doesn't survive in a Window's new context
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:39.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, context, defect |
Reporter | Marshall Culpepper |
Assignee | Don Thorp |
Created | 2011-04-15T02:39:07.000+0000 |
Updated | 2011-04-17T01:54:39.000+0000 |
Description
If you create a window like so:
var myObject = { doSomething: function() { Ti.API.info("hello world"); } }
var window = Ti.UI.createWindow({
url: 'window.js',
myObject: myObject
});
window.open();
You can't access "myObject" from within the Window's context,
like so:
// window.js
var win = Ti.UI.currentWindow;
var myObject = win.myObject;
myObject.doSomething();
How can we work around this until it is fixed?
What's the complexity of this issue? If it's something that can be fixed without ripping apart and putting back together a good chunk of the current codebase, I'm willing to dive into it as I'd really like to have this issue resolved.
Just a clarification: I think the title here is a bit misleading (or the situation has changed since May). In the example,
myObject
is indeed accessible in the second context. It's just that we don't (but will as soon as I push a fix) support calling functions that are properties of that object. If you have a simple string property inmyObject
, for example, you can read that string in the second context.(from [22a8b9af67d67aaaa105bb146f8223fbdc2fbab1]) [#915 state:fixed-in-qa] Support functions (KrollCallbacks) in random data (custom properties, etc.) put on a proxy. http://github.com/appcelerator/titanium_mobile/commit/22a8b9af67d67aaaa105bb146f8223fbdc2fbab1"> http://github.com/appcelerator/titanium_mobile/commit/22a8b9af67d67...
confirmed against 1.4.1.3f9cdc, android and iOS