OData V2 ContextBinding not updated after the size of relatively bound child collection has changed
See original GitHub issueThe description of the issue can be seen here on StackOverflow.
Steps to reproduce the problem:
- Visit this example page: https://embed.plnkr.co/elNMXE/
- Click on any (X)-button to remove an item.
What is the expected result?
After the change has been successfully applied to the child list, calling getProperty("ToProducts")
from the parent context returns the updated length. In the case of the example: From 4 --> 3.
What happens instead?
UI5 always reports the length as 4 because the context binding has not been updated after the changes.
Any other information? (attach screenshot if possible)
- A possible workaround is to append another GET request for the parent ContextBinding to the batch when a DELETE request is going to be sent. But it would be nice if UI5 could update the parent binding automatically if the binding has an
expand
query and a change took place in its child collection that is bound through thatexpand
query. - Everything works fine when equivalent bindings are applied with a JSONModel (obviously without
expand
). This makes me wonder if the issue described here is the intended behavior of UI5 or not. - Haven’t tried with OData V4.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to update ContextBinding (Element Binding ...
If the fix is not available in your current release, one workaround would be to refresh the parent binding by calling parentControl.
Read more >Creating Bindings - SAP Help Portal
Bindings connect SAPUI5 view elements to model data, allowing changes in the model to be reflected in the view element and vice versa....
Read more >OData V2 Model - Documentation - Demo Kit - SAPUI5 SDK
This parameter is used to update list bindings with the new entity after creation, so that it is displayed in the bound table...
Read more >SAPUI5: UI Development Toolkit for HTML5
With the new version of the SAPUI5 OData V2 model, the target of server ... to smart controls (sap.ui.comp library) that do not...
Read more >Data resources in UI Builder
You can use data binding to bind properties to static components to make a dynamic page. When you first add a component to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for reporting this issue and providing samples. This has recently been fixed with
https://github.com/SAP/openui5/commit/ef5f5dc9ba381f72c6a76686e9db1033b434169d
If you change your example page to use openui5nightly.hana.ondemand.com it works as expected.
Sorry, you’re right. This is actually nonsense what I did. 😛 Didn’t think through