sap.ui.model.Binding.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.Binding 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.EventProvider.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.model.Binding.
Returns:
attachAggregatedDataStateChange(fnFunction, oListener?)
Attach event-handler fnFunction
to the 'AggregatedDataStateChange' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
attachChange(fnFunction, oListener?)
Attach event-handler fnFunction
to the 'change' event of this sap.ui.model.Model
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
attachDataReceived(fnFunction, oListener?)
Attach event-handler fnFunction
to the 'dataReceived' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
attachDataRequested(fnFunction, oListener?)
Attach event-handler fnFunction
to the 'dataRequested' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
attachDataStateChange(fnFunction, oListener?)
Attach event-handler fnFunction
to the 'DataStateChange' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
attachEvents(oEvents)
Attach multiple events.
Parameters:
attachRefresh(fnFunction, oListener?)
Attach event-handler fnFunction
to the 'refresh' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
destroy()
Removes all control messages for this binding from the MessageManager in addition to the standard clean-up tasks.
See:
detachAggregatedDataStateChange(fnFunction, oListener?)
Detach event-handler fnFunction
from the 'AggregatedDataStateChange' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
detachChange(fnFunction, oListener?)
Detach event-handler fnFunction
from the 'change' event of this sap.ui.model.Model
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
detachDataReceived(fnFunction, oListener?)
Detach event-handler fnFunction
from the 'dataReceived' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
detachDataRequested(fnFunction, oListener?)
Detach event-handler fnFunction
from the 'dataRequested' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
detachDataStateChange(fnFunction, oListener?)
Detach event-handler fnFunction
from the 'DataStateChange' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
detachEvents(oEvents)
Detach multiple events-
Parameters:
detachRefresh(fnFunction, oListener?)
Detach event-handler fnFunction
from the 'refresh' event of this sap.ui.model.Binding
.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | object on which to call the given function. |
fireDataReceived(mArguments)
Fire event dataReceived to attached listeners. This event may also be fired when an error occured.
Parameters:
{Map} | mArguments | the arguments to pass along with the event. |
{object} | mArguments.data? | the data received. In error cases it will be undefined. |
fireDataRequested(mArguments)
Fire event dataRequested to attached listeners.
Parameters:
{Map} | mArguments | the arguments to pass along with the event. |
initialize()
Initialize the binding. The message should be called when creating a binding. The default implementation calls checkUpdate(true).
isInitial(): boolean
Returns whether the binding is initial, which means it did not get an initial value yet
Returns:
{boolean} | whether binding is initial |
isRelative(): boolean
Returns whether the binding is relative, which means it did not start with a /
Returns:
{boolean} | whether binding is relative |
isSuspended(): boolean
Returns true if the binding is suspended or false if not.
Returns:
{boolean} | whether binding is suspended |
refresh(bForceUpdate)
Refreshes the binding, check whether the model data has been changed and fire change event if this is the case. For server side models this should refetch the data from the server. To update a control, even if no data has been changed, e.g. to reset a control after failed validation, please use the parameter bForceUpdate.
Parameters:
{boolean} | bForceUpdate | Update the bound control even if no data has been changed |
resume()
Resumes the binding update. Change events will be fired again.
When the binding is resumed, a change event will be fired immediately, if the data has changed while the binding was suspended. For serverside models, a request to the server will be triggered, if a refresh was requested while the binding was suspended.
suspend()
Suspends the binding update. No change events will be fired.
A refresh call with bForceUpdate set to true will also update the binding and fire a change in suspended mode. Special operations on bindings, which require updates to work properly (as paging or filtering in list bindings) will also update and cause a change event although the binding is suspended.
updateRequired(oModel): boolean
Determines if the binding should be updated by comparing the current model against a specified model.
Parameters:
{object} | oModel | The model instance to compare against |
Returns:
{boolean} | true if this binding should be updated |