Event handler

Firing an fx-action on bubbling event

In this example a usual html button will fire an event via javascript. This event will then be caught by the fx-action which is a bubbling listener on the 'custom' event.

As actions by default attach the listener to their parent element (fx-fore here) the fx-action will receive the event.

The event() function allows us to use the event detail params in further actions.

Attach a listener to a specific element (at target handler)

Attach document listener

By setting the target attribute to '#document' a global eventlistener can be attached