Class sap.ui.model.odata.v2.ODataTreeBindingModule: sap/ui/model/odata/v2/ODataTreeBinding
Tree binding implementation for odata models. To use the v2.ODataTreeBinding with an odata service, which exposes hierarchy annotations, please consult the "SAP Annotations for OData Version 2.0" Specification. The necessary property annotations, as well as accepted/default values are documented in the specification.
In addition to these hieararchy annotations, the ODataTreeBinding also supports (cyclic) references between entities based on navigation properties. To do this you have to specify the binding parameter "navigation". The pattern for this is as follows: { entitySetName: "navigationPropertyName" }. Example: { "Employees": "toColleagues" }
In OperationMode.Server, the filtering on the ODataTreeBinding is only supported with initial filters. However please be aware that this applies only to filters which do not obstruct the creation of a hierarchy. So filtering on a property (e.g. a "Customer") is fine, as long as the application can ensure, that the responses from the backend are enough to construct a tree hierarchy. Subsequent paging requests for sibiling and child nodes must also return responses since the filters will be sent with every request. Filtering with the filter() function is not supported for the OperationMode.Server.
With OperationMode.Client and OperationMode.Auto, the ODataTreeBinding also supports control filters. In these OperationModes, the filters and sorters will be applied clientside, same as for the v2.ODataListBinding. The OperationModes "Client" and "Auto" are only supported for trees which will be constructed based upon hierarchy annotations.
sClassName
and enriches it with the information contained in oClassInfo
.{sap.ui.model.Model} | oModel | |
{string} | sPath | |
{sap.ui.model.Context} | oContext | |
{sap.ui.model.Filter[]} | aApplicationFilters? | predefined filter/s (can be either a filter or an array of filters). All initial filters, will be sent with every request. Filtering on the ODataTreeBinding is only supported with initial filters. |
{object} | mParameters? | Parameter Object |
{object} | mParameters.treeAnnotationProperties? | This parameter defines the mapping between data properties and the hierarchy used to visualize the tree, if not provided by the services metadata. For correct metadata annotation, please check the "SAP Annotations for OData Version 2.0" Specification. |
{int} | mParameters.treeAnnotationProperties.hierarchyLevelFor? | Mapping to the property holding the level information, |
{string} | mParameters.treeAnnotationProperties.hierarchyNodeFor? | Mapping to the property holding the hierarchy node id, |
{string} | mParameters.treeAnnotationProperties.hierarchyParentNodeFor? | Mapping to the property holding the parent node id, |
{string} | mParameters.treeAnnotationProperties.hierarchyDrillStateFor? | Mapping to the property holding the drill state for the node, |
{object} | mParameters.navigation? | An map describing the navigation properties between entity sets, which should be used for constructing and paging the tree. |
{int} | mParameters.numberOfExpandedLevels? | This property defines the number of levels, which will be expanded initially. Please be aware, that this property leads to multiple backend requests. Default value is 0. |
{int} | mParameters.rootLevel? | The root level is the level of the topmost tree nodes, which will be used as an entry point for OData services. Conforming to the "SAP Annotations for OData Version 2.0" Specification, the root level must start at 0. Default value is thus 0. |
{string} | mParameters.batchGroupId? | Deprecated - use groupId instead: sets the batch group id to be used for requests originating from this binding |
{string} | mParameters.groupId? | sets the group id to be used for requests originating from this binding |
{sap.ui.model.Sorter[]} | aSorters? | predefined sorter/s (can be either a sorter or an array of sorters) |
{int} | mParameters.threshold? | a threshold, which will be used if the OperationMode is set to "Auto". In case of OperationMode.Auto, the binding tries to fetch (at least) as many entries as the threshold. Also see API documentation for sap.ui.model.OperationMode.Auto. |
{boolean} | mParameters.useServersideApplicationFilters? | set this flag if $filter statements should be used for the $count/$inlinecount and data-retrieval in the OperationMode.Auto. Only use this if your backend supports prefiltering the tree and is capable of responding a complete tree hierarchy, including all inner nodes. To construct the hierarchy on the client, it is mandatory that all filter-matches include their complete parent chain up to the root level. OperationMode.Client will still request the complete collection without filters, since they will be applied clientside. |
sClassName
and enriches it with the information contained in oClassInfo
. oClassInfo
might contain the same kind of information as described in sap.ui.model.TreeBinding.extend.
{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 |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
Since 1.34.0 complete clientside filtering is supported for OperationMode.Client and in OperationMode.Auto, in case the backend-count is lower than the threshold. In this case all control and application filters will be applied on the client. See also: sap.ui.model.odata.OperationMode.Auto, sap.ui.model.FilterType.
For the OperationMode.Client and OperationMode.Auto, you may also specify the "useServersideApplicationFilters" constructor binding parameter. If this is set, the Application filters will always be applied on the backend, and thus trigger an OData request. Please see the constructor documentation for more information.
{sap.ui.model.Filter[]|sap.ui.model.Filter} | aFilters | |
{sap.ui.model.FilterType} | sFilterType | Type of the filter which should be adjusted, if it is not given, the standard behaviour FilterType.Client applies |
{sap.ui.model.odata.v2.ODataTreeBinding} | returns this to facilitate method chaining |
sap.ui.model.TreeBinding.prototype.filter |
{Object} | oContext | the context element of the node |
{int} | the number of children |
{string} | sFormat | Value for the $format Parameter |
- Since:
- 1.28
{string} | URL which can be used for downloading |
{sap.ui.model.Context} | oContext | the context for which the child nodes should be retrieved |
{int} | iStartIndex | the start index of the requested contexts |
{int} | iLength | the requested amount of contexts |
{int} | iThreshold |
{sap.ui.model.Context[]} | the contexts array |
{int} | iStartIndex? | the start index of the requested contexts |
{int} | iLength?, Default: v2.ODataModel.sizeLimit | the requested amount of contexts. If none given, the default value is the size limit of the underlying sap.ui.model.odata.v2.ODataModel instance. |
{int} | iThreshold? | the number of entities which should be retrieved in addition to the given length. A higher threshold reduces the number of backend requests, yet these request blow up in size, since more data is loaded. |
{sap.ui.model.Context[]} | an array containing the contexts for the entities returned by the backend, might be fewer than requested if the backend does not have enough data. |
{sap.ui.model.Context} | oContext | the context element of the node |
{boolean} | true if node has children |
{sap.ui.model.odata.v2.ODataTreeBinding} | The binding instance |
{boolean} | bForceUpdate? | Update the bound control even if no data has been changed |
{string} | sGroupId? | The group Id for the refresh |
{int} | iRootLevel |
{sap.ui.model.Sorter[]|sap.ui.model.Sorter} | aSorters | the Sorter or an Array of sap.ui.model.Sorter instances |
{sap.ui.model.odata.v2.ODataTreeBinding} | returns this to facilitate method chaining |