Jean-Luc,

You scenario questions make me wonder; when does a function in a
viewHelper or viewLocator (or MXML file) merit becoming a command? 
In my opinion, I don't see any reason not to call one command from
another (dispatch or direct call).  For instance getData calls
calculateTotals on result.  Since commands are in the same
abstraction layer, this should be OK.  However crossing layers by
calling a view function from a command should be avoided. 

What does the view function actually do.  If it updates the view,
then you can rework this to have your command update state variables
or VO's in the ModelLocator that are bound to the view. This will
automatically update the view.  If the function does anything else,
perhaps the function should become a command.  This was my thought
process when addressing similar issues.  I would love to hear what
Steven and/or Ali have to say about this.

Regards,
Tim Hoff


--- In [email protected], "Jean-Luc ESSER" <[EMAIL PROTECTED]> wrote:
>
> How do i "listen" to a value change in a var ?
>
> Let's say i have a component CompA.
> In this component is a function FunctionA which needs to be
triggered when an event is dispatched from a component CompB.
> Using Cairngorm, i dispatch an event from CompB, running a Command.
> For now, i trigger FunctionA from the Command (ie
Application.application.CompA.FunctionA(myObject) ).
> But that is not how Cairngorm is supposed to work, right ?
> The way i should do it, i guess, is by updating a var myVar to
myObject in my ModelLocator from my Command.
> Then, via bindings, in CompA, listen to myVar, and when changing
to myObject, trigger FunctionA.
>
> Am i right ?
> But how would i do this ?
>
> Help is welcome.
>
> -Jean-Luc
>







--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to