Skip to Content

SAPUI5 oDataModel getProperty method not working because the GUID filed

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:

1594376137446.png (55.4 kB)
1594376204716.png (33.7 kB)
1594376328652.png (44.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jul 10, 2020 at 12:33 PM

    Hi Hong Wei,

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2020 at 01:00 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2020 at 03:07 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 13, 2020 at 07:44 AM

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

     .getModel().getData();
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.