eventemitter
Reactive icon

Event Emitter

Stable version 1.1.2 (Compatible with OutSystems 11)
Uploaded
 on 07 February 2023
 by 
5.0
 (3 ratings)
eventemitter

Event Emitter

Documentation
1.1.2

How to use?

To trigger events, use the EventEmitter_TriggerEvent client action. Pass the following arguments:

  • EmittingWidgetId
    The id of the widget that should be considered as the 'origin' of the event. Determines the context of the event (see below for more info).
  • EventName
    Name of the event. Used by EventHandlers.
  • Arg
    OptionalText argument for the event.
    For more complex arguments you can use JSON Serialize and JSON Deserialize to pass lists and structures.


To handle events, use the EventHandler block.
Takes a list of EventNames as an input parameter. This determines the events that will be handled.

This block throws an Event when it handles an event with one ot these names triggered by EventEmitter_TriggerEvent. Add a handler to handle this event. 

Only events sent from within the same EventEmitterContext will be handled. If no EventEmitterContext is used (it is optional), a 'global' EventEmitterContext will be attached to the javascript window object.


(Optional) EventEmitterContext

Use the EventEmitterContext block to isolate event handling in a section of the application. All events triggered in a separate EventEmitterContext will only be handled by EventHandler blocks in the same EventEmitterContext.

If no EventEmitterContext is used (it is optional), a 'global' EventEmitterContext will be attached to the javascript window object.


See the demo application for an example of all these use cases.


1.1.1

How to use?

To trigger events, use the EventEmitter_TriggerEvent client action.  Pass the following arguments:

  • EmittingWidgetId
    The id of the widget that should be considered as the 'origin' of the event.  Determines the context of the event (see below for more info).
  • EventName
    Name of the event.  Used by EventHandlers.
  • Arg
    OptionalText argument for the event.
    For more complex arguments you can use JSON Serialize and JSON Deserialize to pass lists and structures.


To handle events, use the EventHandler block.
Takes a list of EventNames as an input parameter.  This determines the events that will be handled.

This block throws an Event when it handles an event with one ot these names triggered by EventEmitter_TriggerEvent.  Add a handler to handle this event. 

Only events sent from within the same EventEmitterContext will be handled.  If no EventEmitterContext is used (it is optional), a 'global' EventEmitterContext will be attached to the javascript window object.


(Optional) EventEmitterContext

Use the EventEmitterContext block to isolate event handling in a section of the application.  All events triggered in a separate EventEmitterContext will only be handled by EventHandler blocks in the same EventEmitterContext.

If no EventEmitterContext is used (it is optional), a 'global' EventEmitterContext will be attached to the javascript window object.


See the demo application for an example of all these use cases.



1.0.0
How to use?

To trigger events, use the EventEmitter_TriggerEvent client action.  Pass the following arguments:

  • EmittingWidgetId
    The id of the widget that should be considered as the 'origin' of the event.  Determines the context of the event (see below for more info).
  • EventName
    Name of the event.  Used by EventHandlers.
  • Arg
    OptionalText argument for the event


To handle events, use the EventHandler block.
Takes a list of EventNames as an input parameter.  This determines the events that will be handled.

This block throws an Event when it handles an event with one ot these names triggered by EventEmitter_TriggerEvent.  Add a handler to handle this event. 


(Optional) EventEmitterContext

Use the EventEmitterContext block to isolate event handling in a section of the application.  All events triggered in a separate EventEmitterContext will only be handled by EventHandler blocks in the same EventEmitterContext.


See the demo application for an example of all these use cases.