Package | com.asfusion.mate.actions.builders |
Class | public class EventAnnouncer |
Inheritance | EventAnnouncer ObjectBuilder BaseAction AbstractAction |
Implements | IAction |
Subclasses | ResponseAnnouncer |
EventAnnouncer
allows you to dispatch events from a IActionList
.
When the IActionList
is executed, it will create an event of the class specified in the generator
attribute.
It will then add any properties to the newly created event and dispatch it.
You can pass properties to the event that come from a variety of sources,
such as the original event that triggered the IActionList
, a server result object, or any other value.
The <EventAnnouncer>
tag has the following tag attributes:
<EventAnnouncer Properties generator="Class" constructorArguments="Object|Array" type="String" bubbles="true|false" cancelable="true|false" />
<EventAnnouncer generator="MyEventClass" type="myEventType"/> <Properties myProperty="myValue" myProperty2="100"/> </EventAnnouncer/>
See also
Property | Defined by | ||
---|---|---|---|
bubbles : Boolean
Although you can specify the event's bubbles property, whether you set it to true or false will have little effect,
as the event will be dispatched from the Mate Dispatcher itself.
| EventAnnouncer | ||
cancelable : Boolean
Indicates whether the behavior associated with the event can be prevented.
| EventAnnouncer | ||
constructorArguments : *
The constructorArgs allows you to pass an Object or an Array of objects to the contructor
when the instance is created.
| ObjectBuilder | ||
dispatcherType : String
String that defines whether the dispatcher used by this tag is
global or
inherit . | EventAnnouncer | ||
generator : Class
The generator attribute specifies what class should be instantiated.
| EventAnnouncer | ||
properties : ArrayProperties allows you to add properties to the currentInstance . | BaseAction | ||
registerTarget : Boolean
Registers the newly created object as an injector target.
| ObjectBuilder | ||
type : String
The type attribute specifies the event type you want to dispatch.
| EventAnnouncer |
Method | Defined by | ||
---|---|---|---|
The last method that
trigger calls. | AbstractAction | ||
createInstance(scope:IScope):Object
Where the currentInstance is created using the
generator class as the template, passing arguments to the constructor
as specified by the constructorArgs (if any). | EventAnnouncer | ||
The first method that
trigger calls. | ObjectBuilder | ||
Where all the action occurs.
| EventAnnouncer | ||
setProperties(scope:IScope):void
Where all the properties are set into the
currentInstance . | BaseAction |
bubbles | property |
bubbles:Boolean
[read-write]Although you can specify the event's bubbles property, whether you set it to true or false will have little effect, as the event will be dispatched from the Mate Dispatcher itself.
The default value is false
.
public function get bubbles():Boolean
public function set bubbles(value:Boolean):void
cancelable | property |
cancelable:Boolean
[read-write]Indicates whether the behavior associated with the event can be prevented.
The default value is true
.
public function get cancelable():Boolean
public function set cancelable(value:Boolean):void
dispatcherType | property |
dispatcherType:String
[read-write]
String that defines whether the dispatcher used by this tag is global
or
inherit
. If it is inherit
, the dispatcher used is the
dispatcher provided by the EventMap where this tag lives.
public function get dispatcherType():String
public function set dispatcherType(value:String):void
generator | property |
generator:Class
[read-write]The generator attribute specifies what class should be instantiated. If this attribute is not specified, then a DynamicEvent will be generated.
The default value is mx.events.DynamicEvent
.
public function get generator():Class
public function set generator(value:Class):void
type | property |
type:String
[read-write]The type attribute specifies the event type you want to dispatch.
The default value is null
.
public function get type():String
public function set type(value:String):void
createInstance | () | method |
protected override function createInstance(scope:IScope):Object
Where the currentInstance is created using the
generator
class as the template, passing arguments to the constructor
as specified by the constructorArgs
(if any).
scope:IScope |
Object |
run | () | method |
protected override function run(scope:IScope):void
Where all the action occurs. At this moment, the currentInstance
is already instantiated and all the properties are already set.
scope:IScope |