on 09-18-2018 7:18 AM
Hai Experts,
I am developing one SAPUI5 application, in that I am trying to use busy indicator while triggering the odata and need to close it once after getting the response. I am using the below code.
this.getView().setBusy(true);
this.getView().setBusy(false);
but the above is not working as expected, Tried using the setTimeout() , but no luck. Kindly help me to resolve the same.
Thanks,
Muhsin
Hi Muhsin,
Please try with the following code :
var oDataModel = this.getView().getModel(); // Model used for triggering the Odata Request
oDataModel.attachRequestSent(function() {
sap.ui.core.BusyIndicator.show(100);
});
oDataModel.attachRequestCompleted(function() {
sap.ui.core.BusyIndicator.hide();
});
Thanks,
Vaibhav Maheshwari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Vaibhav,
Thanks for your reply..
Its working now, I have used the below code to close the busy indicator.
jQuery.sap.delayedCall(500, this, function(oEvent) {
this.getView().setBusy(false);
});
Thanks,
Muhsin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Muhsin,
The above method you are using is not recommended. Your oData call may take more than 500ms sometimes.
Better to use success and error method of oData call.
this.oModel().read(sPath, {
success: function(oData) {
this.getView().setBusy(false);
}.bind(this),
error: function(error) {
this.getView().setBusy(false);
}.bind(this)
});
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.