Skip to content
neoneo edited this page Apr 19, 2012 · 7 revisions

For every event, and in some other instances, a new Event object is created. Handling a request also begins with an event. Additionally, during the event handling other events can be dispatched, which leads to new Event instances.

You can use an Event object just like a struct in the event handlers in your controllers, to pass information on to subsequent tasks. The object itself is not passed to view templates. Views only receive a properties struct, obtained with getProperties().

The Event object has the following methods:

string getTarget()

Returns the target of the event.

string getType()

Returns the event type.

void cancel()

Cancels the event, and stops subsequent task execution for this event.

boolean isCanceled()

Returns whether or not the event is canceled.

struct getProperties()

Returns a struct containing all the data that is put on the object.

struct setProperties(required struct)

Appends the data in the struct on the object. Existing data is not overwritten.

Event clone()

Returns a copy of the event. The clone's canceled state is reset (false).

void abort()

Aborts event execution. This does not abort the request, control is given back to the caller (usually Application.cfc).

Clone this wiki locally