Provides eventing capabilities for objects like attaching or detaching event handlers for events which are notified when events are fired.
Method | Description |
---|---|
attachEvent |
Attaches an event handler to the event with the given identifier. |
attachEventOnce |
Attaches an event handler, called one time only, to the event with the given identifier. When the event occurs, the handler function is called and the handler registration is automatically removed afterwards. |
destroy |
Cleans up the internal structures and removes all event handlers. The object must not be used anymore after destroy was called.
|
detachEvent |
Removes a previously attached event handler from the event with the given identifier. The passed parameters must match those used for registration with #attachEvent beforehand. |
sap.ui.base.EventProvider.extend |
Creates a new subclass of class sap.ui.base.EventProvider with name
|
fireEvent |
Fires an event with the given settings and notifies all attached event handlers. |
getEventingParent |
Returns the parent in the eventing hierarchy of this object. Per default this returns null, but if eventing is used in objects, which are hierarchically structured, this can be overwritten to make the object hierarchy visible to the eventing and enables the use of event bubbling within this object hierarchy. |
sap.ui.base.EventProvider.getMetadata |
Returns a metadata object for class sap.ui.base.EventProvider. |
sap.ui.base.EventProvider.hasListener |
Checks whether the given event provider has the given listener registered for the given event. Returns true if function and listener object both match the corresponding parameters of at least one listener registered for the named event. |
hasListeners |
Returns whether there are any registered event handlers for the event with the given identifier. |
toString |
Returns a string representation of this object. In case there is no class or id information, a simple static string is returned. Subclasses should override this method. |
Attaches an event handler to the event with the given identifier.
Param | Type | DefaultValue | Description |
---|---|---|---|
sEventId | string |
The identifier of the event to listen for |
|
oData | object |
An object that will be passed to the handler along with the event object when the event is fired |
|
fnFunction | function |
The handler function to call when the event occurs. This function will be called in the context of the |
|
oListener | object |
The object that wants to be notified when the event occurs ( |
Attaches an event handler, called one time only, to the event with the given identifier.
When the event occurs, the handler function is called and the handler registration is automatically removed afterwards.
Param | Type | DefaultValue | Description |
---|---|---|---|
sEventId | string |
The identifier of the event to listen for |
|
oData | object |
An object that will be passed to the handler along with the event object when the event is fired |
|
fnFunction | function |
The handler function to call when the event occurs. This function will be called in the context of the |
|
oListener | object |
The object that wants to be notified when the event occurs ( |
Cleans up the internal structures and removes all event handlers.
The object must not be used anymore after destroy was called.
References:
Removes a previously attached event handler from the event with the given identifier.
The passed parameters must match those used for registration with #attachEvent beforehand.
Param | Type | DefaultValue | Description |
---|---|---|---|
sEventId | string |
The identifier of the event to detach from |
|
fnFunction | function |
The handler function to detach from the event |
|
oListener | object |
The object that wanted to be notified when the event occurred |
Creates a new subclass of class sap.ui.base.EventProvider with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.base.Object.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires an event with the given settings and notifies all attached event handlers.
Param | Type | DefaultValue | Description |
---|---|---|---|
sEventId | string |
The identifier of the event to fire |
|
oParameters | object |
Parameters which should be carried by the event |
|
bAllowPreventDefault | boolean |
Defines whether function |
|
bEnableEventBubbling | boolean |
Defines whether event bubbling is enabled on the fired event. Set to |
Returns the parent in the eventing hierarchy of this object.
Per default this returns null, but if eventing is used in objects, which are hierarchically structured, this can be overwritten to make the object hierarchy visible to the eventing and enables the use of event bubbling within this object hierarchy.
Returns a metadata object for class sap.ui.base.EventProvider.
Checks whether the given event provider has the given listener registered for the given event.
Returns true if function and listener object both match the corresponding parameters of at least one listener registered for the named event.
Param | Type | DefaultValue | Description |
---|---|---|---|
oEventProvider | sap.ui.base.EventProvider |
The event provider to get the registered events for |
|
sEventId | string |
The identifier of the event to check listeners for |
|
fnFunction | function |
The handler function to check for |
|
oListener | object |
The listener object to check for |