class staticbo.shared. EventHandlerList
Source: shared/
Provides methods to manage the event handlers of a business object instance.
new EventHandlerList()
Creates a new event handler list object.
Methods
add(modelName, event, handler)
Adds a new event handler to to list.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
modelName |
string |
|
The name of the business object model. |
event |
|
The event to listen. |
|
handler |
|
A function to be invoked when the event is emitted. |
- Throws
-
Argument error: The model name must be a non-empty string.
-
Argument error: The event must be a DataPortalEvent member.
-
Argument error: The handler must be a function.
protectedsetup(target)
Adds the event handlers with the model name of the target object to the target object for all events. This method is called by models internally to set up the event handlers.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
target |
(bo.ModalBase or bo.CollectionBase) |
|
A business object instance. |
- Throws
-
Argument error: The model name must be a non-empty string.