Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8800

oData Binding - Child entity in list bound to parent

$
0
0

Hi SAPUI5 experts, A complex binding question. My oData model consists of a main entityset "Invoices" and an associated entityset "Notes", with a one to many relationship Invoice-->Notes The oData model works fine, so this is not a model question. In an XML view, I have a List control bound to the Invoices entityset. This works. What I want to do is include the 1st note from the related Notes entityset in the list of invoices. i.e. access the 1st element of a child oData entityset in a list bound to the parent entity. When I was testing this with a Json model, it was easy, since Json is basically just a set of nested arrays. The following code worked just fine:        etc... Question is, how can I do this using an oData model, where Invoices and Notes are separate (but related) entitysets I have searched in the forum many times and read all the help and have been playing around with various uses of path, bindElement() etc but nothing seems to work. Is there an obvious way to achieve this? Maybe I should use a js view, to have more control over how the list is initially built? I may try this, when I have time. In the end, I just included the required text of the 1st Note as a property in the Invoice entity itself, but this seems like a clumsy solution to what may be a simple problem. Thanks & Regards, Mike


Viewing all articles
Browse latest Browse all 8800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>