Promotic

AddEvent - method of the PmfObject object

Description:
Registers a function into selected event.
Syntax:
Empty AddEvent(String sEventName, String sFuncId, Function Func)
Parameters:
sEventName(String) Event name of the corresponding Pmf object.
sFuncId(String) Identifier of registered event function.
- Allows removal of function by the RemoveEvent method.
- Prevents duplicate registering of the same function.
- May contain any characters (this is not a system name).
- Must not be an empty string.
- It is recommended to use e.g. the whole path to Pmg object (if this method is called in the event of the Pmg object).

If this method is called with the previously registered identifier, then this method would fail and an error statement is added to into the global errors of the INFO system.
Func(Function) The event function will be called when the event is triggered.
Note:
This method is also functional in Web panels.
This method is functional only for JavaScript language.
See also:
Example1:
JavaScriptSelect and copy to clipboard

function onEAccept(ev)
{
// ...
}

oPmf.AddEvent("onEditAccept", "sFuncId", onEAccept);
Example2:
See examples in events PmfButton.onAction, onEditAccept etc.

History:
Pm9.00.07: Created
PROMOTIC 9.0.21 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.