ListenerRegistrationAPI¶
Description¶
These functions allow adding and removing listeners to be able to react to events on arbitrary nodes.
- induceEvent(nodeID, event, recursive)¶
- Arguments
nodeID (
number()
) –event (
WebVisEvent()
) –recursive (
boolean()
) – Optional- Returns
void
- registerListener(eventTypes, listener, nodeID, observeSubTree)¶
Registers thelistener
to the node with the matchingnodeID
and returns the id of the listener. TheobserveSubTree
flag allows to observe the whole subtree under the respective node with thelistener
. With theeventTypes
array, you can specify the types of events the listener should be reacting on. If an empty array is passed, the listener will react on all event types.
- Arguments
eventTypes – (Array<EventType> ) The kind of events on which the event listener should listen
listener – (IEventListener ) The event listener
nodeID (
number()
) – The ID of the node on which the event listener should be registered OptionalobserveSubTree (
boolean()
) – Indicates wether the event listener should also listen to events in all child nodes Optional- Returns
number – The ID of the event listener
- unregisterListener(listenerID)¶
Removes the listener for the givenlistenerID
.
- Arguments
listenerID (
number()
) – The ID of the event listener that should be unregistered- Returns
void