on 07-10-2017 3:57 PM
Hi Team.
I had one issue when i create the oData object from manifest.json file all the call from UI5 TO Backend are made asynchronous. Like in below case.
omodel.create('/ZuserLeaveset', leaveDetails, null, function(oData, oResponse) { alert("Request No" + oResponse.data.RequestNo + "is created"); }, function(error) { alert("Create failed"); });
system is not stopped and execute the next line. It like system call the service create method in parallel mode.
but If i created the same object in component.js file i didn't get that issue. System call the create object in synchronous mode. System wait until the backend process is not completed.
Below is the code for creating oData object.
In component.js
var oModel = new sap.ui.model.odata.ODataModel( "/xxx/xx/odata/sap/ZZLEAVE_SRV/");
In Manifest.js
invoiceRemote": { "uri": "http://xxxxxx.xxx.com:xxx/sap/opu/odata/sap/ZZLEAVE_SRV/", "type": "OData", "settings": { "odataVersion": "2.0" }
Can you please let me know what the exact difference.???
i have changed the version from 2.0 to 1.0 in manifest file . it still behave the same.
How i can pass the same in ocreate method. How i can change the asynch of odata object. .
Thanks
Nishant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nishant Bansal,
1. In component.js, you're creating Odata model v1.
In case of Odata model v1, create method has async param as false, so it will process in sequence.
https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.ui.model.odata.ODataModel.html
2. In manifest.js, you use Odata model v2.
CRUD methods of odata model v2 are async. That's why it will run parallel.
https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.ui.model.odata.v2.ODataModel.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.