Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Odata Model vs Jquery Ajax

There are various ways by which we can call an Odata webservice in our fiori/ui5 application  for eg. using Odata model or by using Jquery Ajax.

Which of the method is preferred in different circumstances and what are the advantages/disadvantages which needs to be considered while deciding the approach.





The UI5 models use jQuery.ajax themselves which you can see if you delve into the .js files (e.g. resources\sap\ui\model\json\JSONModel.js).

The main advantage to using a model is that it holds your data and you can bind your UI5 controls to it - suggest you check out this link for more information

There may be certain situations where you would want to use your own jQuery.ajax call, for example posting data from your application to a web service.

all Model which is introduced in sapui5 internally use same concept as jQuery Ajax.

1. jQuery Ajax is a hard coded process. Via this checking return data type, Accordingly Parsing and Binding of data is your responsibility.

2. Using Model is beast practice when you know your services return data  type,According that you can bind directly and use it.

1 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question