question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OData V2 ContextBinding not updated after the size of relatively bound child collection has changed

See original GitHub issue

The description of the issue can be seen here on StackOverflow.

Steps to reproduce the problem:

  1. Visit this example page: https://embed.plnkr.co/elNMXE/
  2. 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. bindingcontext-not-updated

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 that expand 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
goligocommented, May 11, 2017

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.

0reactions
boghyoncommented, Feb 18, 2019

You do expand “ToProducts”, but at the same time tell the framework not to wait for the request to be completed, but send additional requests for the lists in parallel.

Sorry, you’re right. This is actually nonsense what I did. 😛 Didn’t think through

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found