Appcelerator Titanium: How to use the onLoad event of an Window?

Var LoginWindow = Titanium.UI. CreateWindow ({ backgroundColor:'#1E563F', url:'Login. Js', }); mainWin.

AddEventListener('open', checkPage); mainWin. PageLoad = false; function checkPage() { if(mainWin. PageLoad) { mainWin.open(); } else { mainWin.close(); LoginWindow.open(); } } mainWin.open() This should work.

Var LoginWindow = Titanium.UI. CreateWindow ({ backgroundColor:'#1E563F', url:'Login. Js', }); mainWin.

AddEventListener('open', checkPage); mainWin. PageLoad = false; function checkPage() { if(mainWin. PageLoad) { mainWin.open(); } else { mainWin.close(); LoginWindow.open(); } } mainWin.open(); This should work....

This worked bro.. thanks – theJava Apr 5 at 14:50.

MainWin. PageLoad = false; mainWin. AddEventListener('load', function(e) { if(mainWin.

PageLoad) { mainWin.open(); } else { mainWin.close(); var LoginWindow = Titanium.UI. CreateWindow({ title : 'Login', url:'Login. Js' }); LoginWindow.open(); } }).

I tried your way, have updated my code too... but everytime it loads mainWin.open() irrespective of the boolen value changed. – theJava Apr 5 at 10:20.

The reason is probably that the the variable is updated to true before the event is dispatched. Did you try to print to console the mainWin. PageLoad value?

Where do you update the variable to true?

Its yeilding me false only – theJava Apr 5 at 12:52.

Try using the focus event instead of the load event.

Even that does not work... – theJava Apr 5 at 12:39 then can I suggest you post all your code to a pastie because either or the two approaches described here should work so the problem must lie elsewhere – Aaron Saunders Apr 5 at 13:54.

The reason is probably that the the variable is updated to true before the event is dispatched. Did you try to print to console the mainWin. Where do you update the variable to true?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions