Class sap.ui.model.odata.v4.ODataListBindingModule: sap/ui/model/odata/v4/ODataListBinding
List binding for an OData V4 model. An event handler can only be attached to this binding for the following events: 'change', 'dataReceived', 'dataRequested', and 'refresh'. For other events, an error is thrown.
Constructor Summary
new sap.ui.model.odata.v4.ODataListBinding(oModel, sPath, oContext?, mParameters?)DO NOT CALL this private constructor for a new
ODataListBinding
, but rather use bindList instead!Event Summary
change(oEvent)The 'change' event is fired when the binding is initialized or new contexts are created or its parent context is changed.
dataReceived(oEvent)The 'dataReceived' event is fired after the back end data has been processed and the registered 'change' event listeners have been notified.
dataRequested(oEvent)The 'dataRequested' event is fired directly after data has been requested from a back end.
Method Summary
sap.ui.model.odata.v4.ODataListBinding.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.odata.v4.ODataListBinding with name
sClassName
and enriches it with the information contained in oClassInfo
.sap.ui.model.odata.v4.ODataListBinding.getMetadata()Returns a metadata object for class sap.ui.model.odata.v4.ODataListBinding.
getContexts(iStart?, iLength?, iThreshold?)Returns already created binding contexts for all entities in this list binding for the range determined by the given start index
iStart
and iLength
.Methods borrowed from class sap.ui.model.ListBinding
Methods borrowed from class sap.ui.model.Binding
attachAggregatedDataStateChange, attachChange, attachDataReceived, attachDataRequested, attachDataStateChange, attachEvents, attachRefresh, destroy, detachAggregatedDataStateChange, detachChange, detachDataReceived, detachDataRequested, detachDataStateChange, detachEvents, detachRefresh, fireDataReceived, fireDataRequested, isRelative, isSuspended, updateRequired
Methods borrowed from class sap.ui.base.EventProvider
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.odata.v4.ODataListBinding(oModel, sPath, oContext?, mParameters?)
DO NOT CALL this private constructor for a new
ODataListBinding
, but rather use bindList instead! Parameters:
{sap.ui.model.odata.v4.ODataModel} | oModel | The OData V4 model |
{string} | sPath | The binding path in the model; must not be empty or end with a slash |
{sap.ui.model.Context} | oContext? | The parent context which is required as base for a relative path |
{object} | mParameters? | Map of binding parameters which can be OData query options as specified in "OData Version 4.0 Part 2: URL Conventions" or the binding-specific parameters "$$groupId" and "$$updateGroupId". Note: Binding parameters may only be provided for absolute binding paths as only those lead to a data service request. The following OData query options are allowed:
|
{string} | mParameters.$$groupId? | The group ID to be used for read requests triggered by this binding; if not specified, the model's group ID is used, see sap.ui.model.odata.v4.ODataModel. Valid values are undefined , '$auto' , '$direct' or application group IDs as specified in sap.ui.model.odata.v4.ODataModel#submitBatch. |
{string} | mParameters.$$updateGroupId? | The group ID to be used for update requests triggered by this binding; if not specified, the model's update group ID is used, see sap.ui.model.odata.v4.ODataModel. For valid values, see parameter "$$groupId". |
- Exceptions:
- {Error}
- If disallowed binding parameters are provided
Event Detail
change(oEvent)
The 'change' event is fired when the binding is initialized or new contexts are created or its parent context is changed. It is to be used by controls to get notified about changes to the binding contexts of this list binding. Registered event handlers are called with the change reason as parameter.
Parameters:
{sap.ui.base.Event} | oEvent | |
{object} | oEvent.getParameters | |
{sap.ui.model.ChangeReason} | oEvent.getParameters.reason | The reason for the 'change' event: Change when the binding is initialized and or a new context is created, or Context when the parent context is changed |
- Since:
- 1.37.0
See:
sap.ui.base.Event |
dataReceived(oEvent)
The 'dataReceived' event is fired after the back end data has been processed and the registered 'change' event listeners have been notified. It is to be used by applications for example to switch off a busy indicator or to process an error. If back end requests are successful, the event has no parameters. The response data is available in the model. Note that controls bound to this data may not yet have been updated; it is thus not safe for registered event handlers to access data via control APIs. If a back end request fails, the 'dataReceived' event provides an
Error
in the 'error' event parameter. Parameters:
{sap.ui.base.Event} | oEvent | |
{object} | oEvent.getParameters | |
{Error} | oEvent.getParameters.error? | The error object if a back end request failed. If there are multiple failed back end requests, the error of the first one is provided. |
- Since:
- 1.37.0
See:
sap.ui.base.Event |
dataRequested(oEvent)
The 'dataRequested' event is fired directly after data has been requested from a back end. It is to be used by applications for example to switch on a busy indicator. Registered event handlers are called without parameters.
Parameters:
{sap.ui.base.Event} | oEvent |
- Since:
- 1.37.0
See:
sap.ui.base.Event |
Method Detail
sap.ui.model.odata.v4.ODataListBinding.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.odata.v4.ODataListBinding 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.model.ListBinding.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 |
sap.ui.model.odata.v4.ODataListBinding.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.odata.v4.ODataListBinding.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |
getContexts(iStart?, iLength?, iThreshold?): sap.ui.model.Context[]
Returns already created binding contexts for all entities in this list binding for the range determined by the given start index
iStart
and iLength
. If at least one of the entities in the given range has not yet been loaded, fires a 'change' event on this list binding once these entities have been loaded asynchronously. A further call to this method in the 'change' event handler with the same index range then yields the updated array of contexts. Parameters:
{number} | iStart? | The index where to start the retrieval of contexts |
{number} | iLength? | The number of contexts to retrieve beginning from the start index; defaults to the model's size limit, see sap.ui.model.Model#setSizeLimit |
{number} | iThreshold? | The parameter iThreshold is not supported. |
- Since:
- 1.37.0
Exceptions:
{Error} | If iThreshold is given |
Returns:
{sap.ui.model.Context[]} | The array of already created contexts with the first entry containing the context for iStart |
See:
sap.ui.model.ListBinding#getContexts |
getCurrentContexts()
Method not supported
- Since:
- 1.37.0
Exceptions:
{Error} |
See:
sap.ui.model.ListBinding#getCurrentContexts |
getDistinctValues()
Method not supported
- Since:
- 1.37.0
Exceptions:
{Error} |
See:
sap.ui.model.ListBinding#getDistinctValues |
getLength(): number
Returns the number of entries in the list. As long as the client does not know the size on the server an estimated length is returned.
- Since:
- 1.37.0
Returns:
{number} | The number of entries in the list |
See:
sap.ui.model.ListBinding#getLength |
initialize()
Initializes the OData list binding. Fires a 'change' event in case the binding has a resolved path.
- Since:
- 1.37.0
See:
sap.ui.model.Binding#initialize |
isLengthFinal(): boolean
Returns
true
if the length has been determined by the data returned from server. If the length is a client side estimation false
is returned. - Since:
- 1.37.0
Returns:
{boolean} | If true the length is determined by server side data |
See:
sap.ui.model.ListBinding#isLengthFinal |
refresh(sGroupId?)
Refreshes the binding. Prompts the model to retrieve data from the server using the given group ID and notifies the control that new data is available. Refresh is supported for absolute bindings.
Note: When calling refresh multiple times, the result of the request triggered by the last call determines the binding's data; it is independent of the order of calls to sap.ui.model.odata.v4.ODataModel#submitBatch with the given group ID.
Parameters:
{string} | sGroupId? | The group ID to be used for refresh; if not specified, the group ID for this binding is used, see sap.ui.model.odata.v4.ODataListBinding. Valid values are undefined , '$auto' , '$direct' or application group IDs as specified in sap.ui.model.odata.v4.ODataModel#submitBatch. |
- Since:
- 1.37.0
Exceptions:
{Error} | If the given group ID is invalid or refresh on this binding is not supported. |
See:
sap.ui.model.Binding#refresh |