When I create a child window from my main window, I'd like to pass a JavaScript object ot it, but I'm not sure if there actually is a way to do it?
Two windows created with TideSDK each have their own JavaScript environement, just like two browser windows (and that's just what they are, If I understand it right), so you can't access a variable in one window from another one. On the other hand, you can access other windows from the one you are in (for example with Ti.UI.getOpenWindows
). So... is there a way to do it?
There are some workarounds I believe are possible, but none of them is very straightforward, and each uses something other then just plain JavaScript:
- using
Ti.Database
orTi.Filesystem
to store the data I want to pass, and then retrieve it from the child window - pass the data to the new window as GET variables,example:
Ti.UI.createWindow("app://page.html?data1=test&data2=foobar");