If you looks at the mx.controls.Alert class, you can only give the show() method a listener object, and that object must implement a click() method. You can't specify which method the Alert may call, so I'm stuck giving it an object that has one click(). If this object happens to be the MXML, then I can't use it for different Alerts, because each one will only call click().
So now I have to decide where the proper place for click() should be. I don't want to use groupdetails.mxml, for the reason stated above (I also have buttons that deactivate groups, and do other things, all backed by Alerts). I don't know if it should go into the DeleteGroupCommand. I supposed I could add a click() method to this command, that kicks off an event that runs the same command, but that seems messy. It also somewhat ties my command to my view, since the Alert is just a UI technicality. This leaves the GroupDetailsViewHelper, but again, using this class for broadcasting a command event might not be right. Thoughts? -Josh --- In flexcoders@yahoogroups.com, "Omar Ramos" <[EMAIL PROTECTED]> wrote: > Why do you have to only have one click method? You can use the Delegate > class to redirect each event to a difrent method. > > Omar Ramos > Itacon Corporation > Technology Manager > > _____ > > From: cazzaran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 05, 2005 4:34 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Simple Cairngorm architecture question > > > > You're right. My question, is where should I put the click() that > kicks off the event. I COULD put it in the MXML, and just have the > view capture the click from the Alert and then broadcast the event, > but a problem occurs once I have more than one button that needs to > have an Alert attached; I can only have one click(). So now I need to > find a place to put a click() for each Alert box... is the right place > inside the Command class for each button's function? > > -Josh > > --- In flexcoders@yahoogroups.com, "Jeff Krueger" <[EMAIL PROTECTED]> wrote: > > Maybe I don't fully understand the question. But it seems that you > would > > broadcast the "DeleteGroup" event only once the click of ok was pressed. > > The broadcast will find the command to do the work and then notify > the view > > helper when done. > > > > Jeff > > > > > > -----Original Message----- > > From: cazzaran [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, April 05, 2005 2:13 PM > > To: flexcoders@yahoogroups.com > > Subject: [flexcoders] Simple Cairngorm architecture question > > > > > > > > I have a simple architectural philosophy question regarding Cairngorm. > > > > I am using the Contoller, Command, and ViewHelper pattern, which is > > working out perfectly -- except in one situation... And it's not that > > I can't get this to work, it's that I'm curious what the proper way to > > do it would be. > > > > I have a delete button that allows my users to delete a Group out of a > > list. The issue is that I need to provide an Alert box with a > > OK/Cancel buttons. This alert box needs to be given a listener object > > with a click() method. > > > > My question is where does this belong? In the MXML that shows the > > Delete button, the DeleteGroupCommand, the ViewHelper associated with > > the view, or somewhere else entirely? This is a kind of hiccup in the > > whole Controller to Command flow... > > > > > > > > > > > > > > Yahoo! Groups Links > > > > > > _____ > > Yahoo! Groups Links > > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/flexcoders/ > > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service > <http://docs.yahoo.com/info/terms/> . Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/