Search the web
Sign In
New User? Sign Up
cairngorm-devel · Cairngorm Developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Command Class and updating the UI   Message List  
Reply | Forward Message #196 of 210 |
Re: [cairngorm-devel] Command Class and updating the UI

What I've done is to have a LoginVO class that has the default values for the login screen and the login form text inputs are bound to it.  The LoginVO instance is in my ModelLocator and when the logout occurs you simply create a new instance.

modelLocator.loginVO = new LoginVO();

Jeff

On Nov 24, 2007, at 3:57 PM, malik_robinson wrote:

Hi,

I have a class called LogoutCommand.as, code snippet below:

public class LogoutCommand implements ICommand {
    
        public var modelLocator:ViewModelLocator = ViewModelLocator.getInstance();
        
        public function LogoutCommand() {
            
        }
        
        public function execute(event:CairngormEvent):void {
            
            modelLocator.workflowState = ViewModelLocator.LOGIN_SCREEN;
            modelLocator.loginBoxMessage = "You have been logged out!";
            
        }
        
        
        
    }

The above code works fine, but when the screen changes back to the login screen, the username and password fields are still filled in with the users' original entries. 

 On logout, I would like those fields to be cleared.  I am unsure on how I would access the fields from my Command Class.  The syntax should be simple, I think I am struggling with "accessibility" and knowing how to interact with an object in a different file or whatever...

On my "LoginScreen.mxml" file I have this control:      <mx:TextInput id="username" width="180"/>   I should be able to set its text or value property to empty string or something, just not sure how to do that from the Command Class if that makes sense.

Any help appreciated...

-




Sun Nov 25, 2007 12:08 pm

jbarts1000
Offline Offline
Send Email Send Email

Forward
Message #196 of 210 |
Expand Messages Author Sort by Date

Hi, I have a class called LogoutCommand.as, code snippet below: public class LogoutCommand implements ICommand { public var modelLocator:ViewModelLocator = ...
malik_robinson
Offline Send Email
Nov 25, 2007
11:47 am

What I've done is to have a LoginVO class that has the default values for the login screen and the login form text inputs are bound to it. The LoginVO instance...
Jeffrey Battershall
jbarts1000
Offline Send Email
Nov 26, 2007
8:54 am

In general in Cairngorm you maintain state in the model and have the view listen to changes to the state and react accordingly. So add a variable to your...
jer_ela
Offline Send Email
Nov 26, 2007
9:32 am

Hi, I¹d recommend reading Paul Williams (of Adobe Consulting) blog ­ he has a series of posts about presentation models, which are a very good pattern to ...
Alistair McLeod
alimcleod
Offline Send Email
Feb 11, 2008
11:54 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help