cancel
Showing results for 
Search instead for 
Did you mean: 

relative binding in relative binding of list

akuller_q
Participant
0 Kudos

Note: the editor throws the code out of the formatting blocks every time. maybe a mod can help?

Update: i have created a repo with an example.

https://gitlab.com/akuller/ui5-list-problem

In the list there is a +1 button on the right, then another appears with +2. I want a new entry to be created in the list 2.

Hello all,

I have a strange behavior at the moment when binding.

First the data: SAPUI5 1.71.50 on customer system

In development environment for testing SAPUI5 1.110.0

oData v2 Service in the backend

I have a ContextBinding on the view.

In this view there is a list which also contains a list. Below is a small example.

... see repo ...

relevant parts of metadata: Base - 1:n -> Sub - 1:n -> lang

... see repo ...

The contextbinding works on the view as well as first list level. On the second list level, it shows the data in the UI5 tools in the binding. However, in the aggregation the items are not filled. In the first list, the items are filled in the aggregation. If I bind the whole thing with a JSON model it works.

Does anyone know a solution to this problem?

Thanks a lot

Best regards

junwu
Active Contributor
0 Kudos

at least put some screenshot if the code is not readable.

akuller_q
Participant
0 Kudos

Hi jun.wu5

i updated the question with a sample.

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

> [...] with a JSON model it works.

ODataModel is a server-side model. With the target SAPUI5 version 1.71, the root entity ("books") has to be persisted in the OData service first, then you can create the new "publisher" entity with the server-provided book ID as the foreign key. Same applies to the "offices" in relation to the "publisher".

akuller_q
Participant
0 Kudos

Hello boghyon.hoffmann

I am aware of that, I first create virtual entries at this point, which are to be sent to the server later.

What I don't really understand, even with UI5 1.71, I can first create the book (virtual) as well as the publisher (exactly like in 1.110) without having to persist it.

If I would also create the book in a list, there is no problem with the code. This does not make much sense from my point of view.

Okay, spontaneously the example with the create of the book in the list does not work. I'll see tomorrow if I can find the code or try to build it again.

If I now assume that it does not work this way. A Deep Create wouldn't help me much either, right? Shadow models are not very elegant.

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

akuqb

In general, applications should not rely on the obsereved behavior. Officially, in 1.71, "deep creates (including data defined by navigation properties) are not supported." (Source: https://sdk.openui5.org/1.71.54/#/api/sap.ui.model.odata.v2.ODataModel/methods/createEntry)

Accepted Solutions (0)

Answers (0)