Hey ,
I have the following code
Titanium.UI.createWindow({ url:'somenewcode.js', title:'your new window', oldWin:Ti.currentWindow // this gets you a pointer });
I want to check whether the oldWin exists in the window created.
I used this
if(Ti.UI.currentWindow.oldWin) { Ti.UI.currentWindow.oldWin.close(); }
but shows error. How can I check whether the oldWin exists
2 Answers
Accepted Answer
Hi Rebin
Fix this error and try again, if you still have a problem - report back.
Change this
Titanium.UI.createWindow({ url:'somenewcode.js', title:'your new window', oldWin:Ti.currentWindow // this gets you a pointer });To this
Titanium.UI.createWindow({ url:'somenewcode.js', title:'your new window', oldWin:Ti.UI.currentWindow // this gets you a pointer });Specific line
oldWin:Ti.UI.currentWindow // this gets you a pointer
Hi Rebin,
What is Ti.UI.currentWindow here - Is there any window that you created before creating this window? Can you please provide the complete code?
As far as I understand, this won't work because you are creating new window using url property which creates a new execution context where your previous variables/objects are not accessible.
Please read this post - (http://developer.appcelerator.com/blog/2010/08/execution-contexts.html)
Your Answer
Think you can help? Login to answer this question!