Automatically opening a new window does not render controls
I want the user to view a "My Account" Section, but if the user is not logged in then they should be forwarded to the "Sign In" page.
My code is opening the correct page, but does not render any of the controls on the sign in page. My code to open the sign in page is:
win.addEventListener('open', function(e) {
//check if signed in
if(!Ti.App.user){
var signinWindow = Ti.UI.createWindow({
url:'../views/signin.js',
...etc
});
Ti.UI.currentTab.open(signinWindow);
}
});
The sign in page works, but no controls rendered. However if I change the "open" event to a "click" event the Sign In page renders it's controls.
Is this something to do with the first window not finished with loading? Is there a window "ready" event?
1 Answer
-
I've also tried this:
Ti.UI.currentTab.open(myAccountWindow); if(!Ti.App.user){ Ti.UI.currentTab.open(signInWindow); }
Same problem: no controls rendered on the signIn window.