|
Ok perfect J You can accomplish
this very cleanly without having to know about any views, buttons or UI
elements, and still do it with the ModelLocator and commands (if you choose).
I prefer to stay away from viewlocators as well, I use binding strategies for
all the view logic, and I have only found a couple of situations where it didn’t
work good (mainly setting verticalScrollPositions and selectedItems on lists).
What I usually do in the situation of the buttons being disabled and enabled is
add a boolean field to the ModelLocator called loggedIn or something of that
nature, bind the UIComponent’s enabled field to that, then set that from
within the commands. For the states issue, I usually define the states
within a state factory or the MXML itself, depending on how complicated the
states are and if I need dynamic states. Then I create a state model that
all my views can bind their currentState to. Then a static list of all
the available states per view (that part can be a bit tedious) and then I can
change the states of views from anywhere in the application. Just make
sure that you bind the name of your state to the static variables you create on
the model, that way everything is consistent. The way you are thinking would work great
too. It would allow you to encapsulate all the code within the MXML files
and make it a bit easier for someone to jump into. The only thing that
steered me away from that approach was forking out some of the logic out of the
commands and back into the views. I am a bit of a purist when it comes to
using frameworks). It’s just what I prefer. But do what works
best for you. I just wanted to make sure you knew it was possible to
accomplish the same thing within the cairngorm framework. From: The biggest things I need to do are update/change the
state of views -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- RE: [flexcoders] Re: Cairngorm, dispatching application ... Dustin Mercer
- [flexcoders] Re: Cairngorm, dispatching application... Derrick Grigg
- RE: [flexcoders] Re: Cairngorm, dispatching applica... Dustin Mercer
- Re: [flexcoders] Re: Cairngorm, dispatching applica... Samúel Jónasson
- RE: [flexcoders] Re: Cairngorm, dispatching applica... Dustin Mercer

