I'd suggest to invoke the popup from a view. IMHO, creating a popup or Alert is something only views should be concerned about. Part 4 of my Cairngorm series talks about this: http://weblogs.macromedia.com/auhlmann/archives/2006/09/cairngorm_sampl_3.cfm#more Basically, your command changes a state in the model and a view (MXML) listens to it with i.e. using an Observe tag. The view could then either call the popup API in a Script block or might use a helper class to do that as Dimitrios showed. 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]
http://weblogs.macromedia.com/auhlmann
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Michael
Ritchie
Sent: 14 December 2006 16:53
To: [email protected]
Subject: [flexcoders] Re: Cairngorm createPopUp in a command
That reminds me of Jesse Warden's Debugger window he uses in his
Cairngorm examples. I looked at this post just yesterday as we needed
to create a custom alert message window that is shown from the Command
onFault function.
What I did was add a new ArrayCollection object to the Model called
errorAlert. Then in the Main.mxml file I created a ArrayCollection
"collectionChange" event listener that handles any change to the
errorAlert. In each command I add create an error object and add
that object to the errorAlert like model.errorAlert.addItem(myObj).
This fires the collectionChange event and from Main.mxml I pop up my
custom alert component.
There seems to be no real elegant way to throw custom message
components from the Command in Cairngorm, but I like your way
Demitrios, it might be cleaner than listening to changes to the
ArrayCollection object. I did think of one advantage of using my
method, you could create a queue of the alert messages and do clean up
with by firing the "collectionChange" event when you removeItemAt from
the ArrayCollection. This could produce and handle multiple alert
messages layered on top of each other.
Michael Ritchie
Xdrive.com
--- In [email protected] <mailto:flexcoders%40yahoogroups.com> ,
"Dimitrios Gianninas"
<[EMAIL PROTECTED]> wrote:
>
> I have this pop up in a library btw. Use like so:
>
> somewhere in the app init:
> StatusWindow.init( rootView );
>
> in your execute() method:
> StatusWindow.show( "Searching...", false );
>
> in your result() method:
> StatusWindow.hide();
>
> in your fault() method:
> StatusWindow.show( "Error", true, "details" );
>
> Dimitrios Gianninas
> RIA Developer
> Optimal Payments Inc.
>
>
> ________________________________
>
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ]
On Behalf Of Dimitrios Gianninas
> Sent: Thursday, December 14, 2006 11:24 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> Subject: RE: [flexcoders] Re: Cairngorm createPopUp in a command
>
>
>
> Tim... what you need is attached :) Enjoy.
>
> I got a whole bunch of them :)
>
> Dimitrios Gianninas
> RIA Developer
> Optimal Payments Inc.
>
>
> ________________________________
>
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ]
On Behalf Of Daniel
> Sent: Thursday, December 14, 2006 11:08 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Re: Cairngorm createPopUp in a command
>
>
>
> Great solutions, however... What if I use Cairngorm as a Library. This
> means that it's outside my Application project and it wouldn't be
> possible to instance in the Command a TitleWindow located in the
project.
>
> Any ideas?
>
> Thanks in advance!
>
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%40yahoogroups.com> , "Tim Hoff" <TimHoff@> wrote:
> >
> > Is it possible to create and remove a popup in a Cairngorm command? I
> > have a simple application that has two primary components; sidePanel
> > and mainPanel. Various child components are added to the primary
> > components, depending on the state of the application. What I want to
> > do is create a popup in the mainPanel when the user clicks a search
> > button in the sidePanel. The popup is a small component that shows a
> > progress bar with a searching label. In the searching command,
> > executed with a cairngormEvent when the sidePanel search button is
> > clicked, I want to create the popup. onResult, remove the popup and
> > change state to display a grid. onFault, remove the popup and display
> > an Alert. I'm having a problem referencing the mainPanel as the popup
> > parent and listening for an event to remove the popup. I've tried
> > several different approaches with no success. If anyone could get me
> > moving in the right direction, I would greatly appreciate it.
> >
> > Thanks in advance,
> > Tim Hoff
> >
>
>
>
> AVIS IMPORTANT
>
> WARNING
>
> Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation. Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système. La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux. Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.
>
> This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient. No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message. If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system. The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful. If you have received this e-mail
in error, please notify the sender.
>
>
>
> --
> WARNING
> -------
> This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient. No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message. If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system. The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful. If you have received this e-mail
in error, please notify the sender.
>
> AVIS IMPORTANT
> --------------
> Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation. Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système. La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux. Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.
>
att4d7bc.gif
Description: att4d7bc.gif

