ODataListBinding: Filter cannot be applied to aggregated property
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
OpenUI5 version: 1.121.0
Browser: Google Chrome
URL (minimal example if possible): https://github.com/tofriede/odata-v4-filter-aggregation
Steps to reproduce the problem:
- Create a sap.ui.model.odata.v4.ODataListBinding
- Aggregate a numeric property
- Apply a sap.ui.model.Filter based on the aggregated property
What is the expected result?
The list binding should execute an OData request with the query option $apply, in which the data is aggregated first and then the corresponding filter is applied. The fact that this should be possible is also mentioned in the documentation under Extension for Data Aggregation (section: Filtering).
What happens instead?
Before the request is fired, the ListBinding analyzes the applied filter and tries to determine the type of the aggregated property via the MetaModel. However, this fails because an alias must be used for the aggregation that is not known to the MetaModel, as this is defined on the client side.
Since the mapping of aliases and original property names is known to the ListBinding (getAggregation), it should also be able to identify the types of aggregated properties.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.