cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 oDataModel getProperty method not working because the GUID filed

0 Kudos

Hi,Expert:

I got a issue when I try to get the data of SAPUI5 ODataModel by getProperty method:

var myModel = this.getView().byId("UploadCollection").getModel();
			 
var itemData = myModel.getProperty("/FileSet");

it dosen't work and I debug and check the oData ,it is not only "FileSet" but "FileSet(guid'f8f21e62-b7e0-1eda-b0b7-3df17b7bf6c1')" -- the guid is added at the end.


and it should be only "FileSet",like below,only "data"

and below is the table which used to create the OData service:

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

In the SAPUI5 demo,it uses getData() method,but it's obsoleted and be replaced by .getProperty()

 .getModel().getData();
junwu
Active Contributor
0 Kudos

myModel.getProperty("/FileSet(guid*************************)/YOURTARGETPROPERTY");"

0 Kudos

Yeap,it works if the guid is known. But here needs to get whole model oData.the GUID can't be specified.

junwu
Active Contributor
0 Kudos

what is your scenario?

0 Kudos

but now can't get data by "var itemData = myModel.getProperty("/FileSet");"

jhodel18
Active Contributor
0 Kudos

Hi Hong Wei,

It really is supposed to be like that, why you say it should be just FileSet?