Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-915] Custom proxy data doesn't survive in a Window's new context

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:54:39.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, context, defect
ReporterMarshall Culpepper
AssigneeDon Thorp
Created2011-04-15T02:39:07.000+0000
Updated2011-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();

Comments

  1. Victor Schelin 2011-04-15

    How can we work around this until it is fixed?

  2. Ryan Coyner 2011-04-15

    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.

  3. Bill Dawson 2011-04-15

    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 in myObject, for example, you can read that string in the second context.

  4. Jeff Haynie 2011-04-15

    (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...

  5. Thomas Huelbert 2011-04-15

    confirmed against 1.4.1.3f9cdc, android and iOS

JSON Source