I absolutely agree that a Command should never invoke anything view
related, except for setting bound model values that update views
automatically.  For Jean-Luc's scenario, my thinking is that there
may be several different views that require closure before the
primary command is executed.  To close any or all of the
possible open views in a clean and synchronous manner, I would think
that you could combine the SequenceCommand (is it ChainCommand now?)
with the ChangeWatcher utility or a simple eventListener.  The
executeNextCommand function would be invoked only after the
SequenceCommand receives notification of the effectEnd event. The
question is, should you use the ChangeWatcher to listen for a model
variable change, that would have to be updated by the view or a
helper?   Or, would an explicit eventListener for the views'
effectEnd event be more suitable?

This is a gray area in Cairngorm for me.  It seems that there may be
times when a complete round-trip of event communication, starting
and ending at a view, may come in handy and/or be necessary.  Well,
maybe not necessary but certainly more convenient.  For me, this
fits in the same category as deciding whether to perform a simple
view action with a ViewHelper/ViewLocator or with yet another
Event/Control/Command/Model structure.   I'm not sure if discussing
theoretical framework implementation is germane to this list, but
I'd be interested to hear further thoughts (best practices)
concerning this topic.  Thanks for your ideas Steven, Alex and
Darren.

Tim Hoff


--- In flexcoders@yahoogroups.com, "Jean-Luc ESSER" <[EMAIL PROTECTED]> wrote:
>
> I do agree with you guys, that's the way to go !
> Thanx !
>
> BTW, loved Paul's little helper.
> This one is a sure hit !
>
> -JL
>
> ----- Original Message -----
> From: "Darren Houle" <[EMAIL PROTECTED]>
> To: <flexcoders@yahoogroups.com>
> Sent: Thursday, June 01, 2006 4:49 PM
> Subject: RE: [flexcoders] Re: Dispatching multiple events in order
with
> cairngorm
>
>
> >I agree with Alex.  Say you have a View with a button... you
mutate that
> > button's click="" event into a CairngormEvent.  Your custom Cg
Event
> > triggers a Cg Command, which sets state in the ModelLocator. 
New to Beta
> > 3
> > is a utility called ChangeWatcher that allows you to watch a
bindable
> > value
> > and define a handler to run when the value changes.  In the
original View
> > (or any other View) you could simply watch that state var and
have
> > ChangeWatcher call yourMoveEffect.play().  You could mutate the
standard
> > effectEnd="" event into a new CairngormEvent that triggered the
Cg Command
> > that needs to run at the end of the effect.
> >
> > Darren
> >
> >
> >
> >>From: "Alex Uhlmann" <[EMAIL PROTECTED]>
> >>Reply-To: flexcoders@yahoogroups.com
> >>To: <flexcoders@yahoogroups.com>
> >>Subject: RE: [flexcoders] Re: Dispatching multiple events in
order with
> >>cairngorm
> >>Date: Thu, 1 Jun 2006 06:46:57 -0700
> >>
> >>Hi Guys,
> >>
> >>
> >>I'd probably suggest letting the view dispatch a Cairngorm
event, having
> >>that following Command change a state in your model and have
that view
> >>bind to that state change in the model. This view will trigger
the
> >>effect and at effectEnd you will trigger another Command. IMHO,
the
> >>Command should never invoke anything view related (like an
effect) by
> >>himself.
> >>
> >>Note that your view (MXML) can bind to the model using the
mx:Binding
> >>tag. BTW: check out Paul's little helper for that.  ;)
>
>>http://weblogs.macromedia.com/paulw/archives/2006/05/the_worlds_sma
l.cfm
> >>#more
> >>
> >>
> >>Best,
> >>Alex
> >>
> >>Alex Uhlmann
> >>Consultant (Rich Internet Applications)
> >>Adobe Consulting
> >>Westpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UK
> >>p: +44 (0) 131 338 6969
> >>m: +44 (0) 7917 428 951
> >>[EMAIL PROTECTED]
> >>
> >>
> >>-----Original Message-----
> >>From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> >>Behalf Of Jean-Luc ESSER
> >>Sent: 01 June 2006 10:35
> >>To: flexcoders@yahoogroups.com
> >>Subject: Re: [flexcoders] Re: Dispatching multiple events in
order with
> >>cairngorm
> >>
> >>Thanx Tim i'm gonna look into this, but i'm worried about one
issue :
> >>In case of a command launching an effect in a component, when
the effect
> >>starts, it means the command has executed, thus invocating the
next
> >>command.
> >>What if i want to wait for effectEnd before invoking next
command...
> >>
> >>I'll keep you posted.
> >>
> >>-JL, investigating.
> >>
> >>----- Original Message -----
> >>From: "Tim Hoff" <[EMAIL PROTECTED]>
> >>To: <flexcoders@yahoogroups.com>
> >>Sent: Thursday, June 01, 2006 11:18 AM
> >>Subject: [flexcoders] Re: Dispatching multiple events in order
with
> >>cairngorm
> >>
> >>
> >> > Hi Jean-Luc,
> >> >
> >> > It looks like you might need to use the Cairngorm
SequenceCommand
> >> > class.  I haven't used this yet but if you look at the source
for the
> >> > SequenceCommand class, it describes a possible solution for
you.  If
> >> > you use this and get it to work, please post your findings
here.
> >> >
> >> > Good Luck,
> >> > Tim
> >> >
> >> >
> >> > --- In flexcoders@yahoogroups.com, "JL E." <flex@> wrote:
> >> >>
> >> >> Hi there !
> >> >>
> >> >> I have a search pane. I open it (sliding to the right).
> >> >> Now, i want to go somewhere else in the application.
> >> >> In order to do that, when clicking on let's say 'contact', i
> >> > dispatch an event which is gonna show page contact.
> >> >> The thing is that when clicking 'contact', before executing
the
> >> > command which is gonna build contact page, i want to check if
the
> >> > search pane is open, and if so, i want to dispatch event
> >> > closeSearchPane, wait until it is fully closed, and only then
execute
> >> > my command showContactPage.
> >> >> I guess coding this logic in my command showContactPage won't
> >> > scale as i may need this logic to work everywhere in the app,
> >> > whichever event i am gonna dispatch.
> >> >> How would you do it ? What am i missing here ?
> >> >>
> >> >> Best,
> >> >> Jean-Luc
> >> >>
> >> >> PS: Thanx Alex for previous answers regarding getters
setters !
> >> > Worked fine !
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Flexcoders Mailing List
> >> > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> >> > Search Archives:
> >> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> >> > Yahoo! Groups Links
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >>
> >>
> >>--
> >>Flexcoders Mailing List
> >>FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> >>Search Archives:
> >>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> >>Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>--
> >>Flexcoders Mailing List
> >>FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> >>Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
> >>Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>







--
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