Here is a simple “Hello World” type of application using Cairngorm Extensions from Universal Mind.
This application demonstrates the following two features of the Cairngorm Extensions:
- Aggregation of event-business logic within a single Command class
- Support for optional view notifications
A detailed list of features in Cairngorm Extensions is available on the Google Code site for Cairngorm Extensions.
This Flex application simply displays a text area box for where a user can input her/his name, and then click on one of the two buttons. Depending on the button clicked, the application displays greeting with the name of the user.
Hi, am not soure but i think UM Cairngorm dos not Extend Command it implements it with ICommand.
public class GreetingsCommand extends Command
for
public class GreetingsCommand implements ICommand
Source : http://flexcairngorm.googlecode.com/svn/trunk/docs/Effectively%20Using%20Cairngorm%20Extensions.pdf
Rene Roberto Ramirez Szabo
Caracas – Venezuela
The UMEvent is not Used Properly it has more parameters that you can use, so you dont have to use Getters and Setters or public varaibles. like the public var name: String = “”;
Example:
public function GreetingsEvent(eventType:String, handlers:IResponder=null, bubbles:Boolean=true, cancelable:Boolean=false, data:Object=null)
{
super(eventType, handlers, bubbles, cancelable, data);
}
the data : Object parameter let us cast it in the command class in this case in the GreetingsCommand.
You can call casting event.data in the command to a VO ( value object ) or a simple string like event.data.name in this case.
Rene Roberto Ramirez Szabo
Caracas – Venezuela
Sorry, you extends Command, so you can use the notifyCallers. Sorry Again.
Hey im trying to include this responder into a project and have updated my command from
public class commandA implements ICommand, Responder
{
to
public class commandA extends Command
but now when i try to create the delegate
var delegate:MyDelegate = new MyDelegate ( this );
delegate.remoteFunc( event.commandArgs );
i get
Implicit coercion of a value of type com.ordering.control.commands:AddItemToPadCommand to an unrelated type com.adobe.cairngorm.business:Responder. AddItemToPadCommand.as
Can u provide an example of the above where it calls the a delegate in the command
thanks