raise

[ Function ]

static raise(
    name: string,
    ...args: any[]
): void;

Triggers an event, based on the event name for all event registrations relating to this event.

Parameter

Name

Type

Description

name

string

Name of the event

args [ residual parameters ]

any

A user-defined number of parameters that are passed through to the event callbacks in addition to the first parameter.

Return value

Type

Description

void

No return value

raise 1:

Available from 1.8

Sample - JavaScript

// Register event
var destroyEvent = TcHmi.EventProvider.register('MyControl.onMyEvent',
    function(evt, data) {
        // Do stuff
        TcHmi.Log.debugEx('event-data:', data);
        // …
        // Destroy to free event resources if event is no longer needed.
        evt.destroy();
    }
);

// Raise event
TcHmi.EventProvider.raise('MyControl.onMyEvent', 42);