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...
Show off your group to the world. Share a photo of your group with us.

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 #198 of 210 |
Re: [cairngorm-devel] Re: Command Class and updating the UI

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 apply in situations such as this:

http://weblogs.macromedia.com/paulw/

Thanks,

Alistair


On 25/11/2007 16:14, "jer_ela" <gela@...> wrote:


 
 

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 model locator loggedIn:Boolean.  Then have your login
 screen listen to changes in the variable either via a ChangeWatcher
or Binding, and clear the controls when it goes false.

--- In cairngorm-devel@yahoogroups.com <mailto:cairngorm-devel%40yahoogroups.com> , "malik_robinson"
<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...
>
> -
>

 
    


Mon Feb 11, 2008 11:54 pm

alimcleod
Offline Offline
Send Email Send Email

Forward
Message #198 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