cancel
Showing results for 
Search instead for 
Did you mean: 

Get key attribute from odata model in order to update

Former Member
0 Kudos

Hi guys,

in our SAPUI5 application we have a site with details for one process. We get the informations for this site from a odata getEntity method. In this site we can change an attribute and want to send an update to the backend.

But for the update we need to pass the complete key. One component of the key is not shown on the detail list (but is available in the odata model), so we can not write it into the update-string. So is there a chance to read the key straight from the odata model? Or how can I handle this?

Thank you in advance,

Bastian

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

so do you bind the element? like

path = "/YourEntitySet(Key1='key1',Key2='key2')";

this.getView().bindElement(path);

if so you can use

this.getView().getBindingContext().getObject();

or

this.getView().getBindingContext().getPath();

former_member185414
Active Contributor
0 Kudos

Hello Bastian,

While displaying the details for one process, (as mentioned by you) you must be getting the full key of the entity. Please use the same while sending the Update request to backend.

BR.