Closed mgerzabek closed 1 month ago
Can you please show the metadata of io.pragmatiqu.Posting, especially the section with its key?
Hello @ThomasChadzelek,
And thank's for the instant reply. This is the shortened version of the posting:
<EntityType Name="Posting">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.Int64" Nullable="false">
<Annotation Term="Org.OData.Core.V1.Computed" Bool="true"/>
</Property>
<Property Name="user_id" Type="Edm.Int64" Nullable="false"/>
<Property Name="project_id" Type="Edm.Int64" Nullable="false"/>
<Property Name="date" Type="Edm.Date" Nullable="true"/>
<Property Name="order" Type="Edm.Int64" Nullable="true" DefaultValue="1">
<Annotation Term="Org.OData.Core.V1.ComputedDefaultValue" Bool="true"/>
</Property>
<Property Name="hours" Type="Edm.Decimal" Nullable="false"/>
<Property Name="comment" Type="Edm.String" Nullable="false"/>
</EntityType>
That looks pretty well. But one thing strikes me now. You've said expand: "contacts,settlements,postings"
- shouldn't that read $expand
for V4? Maybe your service accepts it w/o the $, but the model will not properly understand it.
You're right! With the $
in place everything works now as supposed.
Thank you very much!
You're welcome!
OpenUI5 version:
1.123.0
Browser/version (+device/version):
Chrome 124.0.6367.208
Any other tested browsers/devices(OK/FAIL):
–
Description
In my controller I bind a master-detail view with:
which leads to a
GET Projects(132)?expand=contacts,settlements,postings HTTP/1.1
,that is fulfilled by this JSON response:
I stripped all the content to only show that the structure from my odata v4 service is fine. Also my views are prepared with the necessary data (using
sap.uxap.ObjectPageLayout
), so at the first sight everything is fine.But when I want to edit an expanded entity from postings, and want to access the context for this entity, I get the error
No key predicate known at /Projects(132)/postings/2
.The navigation property in
$metadata
is declared as:In the event handler of a
sap.m.ColumnListItem
I try to get the canonical path of the posting:This always leads to the error:
What is the expected result?
The string for the resolved promise should be
/Postings(2199)
.What happens instead?
The promise is rejected.