on 04-06-2016 1:08 PM
Hello Experts,
I have created a custom Fiori app. My requirement is when I press a Add button, a form opens in which the user needs to fill data in the drop-downs. Each drop-down will get the data from different entity sets from ODATA. I am using filter method to fetch data.Since the control is going to back-end multiple times(for each drop down list), the time consumed is more (approx 2 mins). Is there any way by which I can get the data in one go and make the operation of loading Add page faster?
Hi Priya,
I think you can improve the speed of the app by using the concept of Batch Requests.
The idea is to group several odata requests, in just one.
Look at the following posts:
Also, when developing the odata services, try to follow the best practices listed in the following post:
Regards,
Emanuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Emanuel,
I used the concept of Batch Requests and grouped several odata requests. I am getting the data from back-end. The code what I used is below.
var omodel = this.getView().getModel();
var that = this.getView().getController();
var batchChanges = [];
batchChanges.push(omodel.createBatchOperation(
"/entitySetName?$filter=Value+eq+'xyz'",
"GET"));
batchChanges.push(omodel.createBatchOperation(
"/entitySetName?$filter=Value+eq+'abc'",
"GET"));
omodel.addBatchReadOperations(batchChanges);
omodel.setUseBatch(true);
omodel.submitBatch(function(data) {
sap.ui.commons.MessageBox.show(data.__batchResponses[0].__changeResponses.length + " contacts created", sap.ui.commons.MessageBox.Icon
.SUCCESS,
"Batch Save", sap.ui.commons.MessageBox.Action.OK);
}, function(err) {
alert("Error occurred ");
});
I need to bind the data to dropdowns(Select). Can you help me with this?
Regards,
Priya.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.