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 Description modelNamestring The name of the business object model.
eventbo.shared.DataPortalEvent The event to listen.
handlerexternal.eventHandler 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.
-
-
<protected> setup(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.
Parameters:
Name Type Description targetbo.ModalBase | bo.CollectionBase A business object instance.
Throws:
Argument error: The model name must be a non-empty string.