Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked October 6th 2010 by Roger Chapman
  • events
  • mobile
  • window
0 Comments

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.

    — answered October 6th 2010 by Roger Chapman
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.