on 07-25-2013 9:35 AM
Hi experts,
I tried to show a busyDialog or busyIndicator surrounding an OData-model create:
like this:
var busyDialog4 = (sap.ui.getCore().byId("busy4")) ? sap.ui.getCore().byId("busy4") : new sap.m.BusyDialog('busy4',{text:'test', title: 'Loading'});
busyDialog4.open();
oModel.create("/EintragMenge", oData, null,
function() {
busyDialog4.close();
jQuery.sap.require("sap.m.MessageToast");
sap.m.MessageToast.show("Done");
},
this.confirmTimeError()
);
or like this:
sap.ui.core.BusyIndicator.show();
// oModel.create(...
sap.ui.core.BusyIndicator.hide();
I never made it to show the Dialog or Indicator...
If I tried to open it with a duration and/or delay it seemed that the Indicator is shown after the OData call is done...
Is there a special way to achieve this?
Thanks in advance
Aksel
Message was edited by: Michael Appleby
Hi,
You need to use "attachRequestSent()" and "attachRequestCompleted()" methods to your model.
Try something like this :
oModel.attachRequestSent(function(){busyDialog.open();});
oModel.attachRequestCompleted(function(){busyDialog.close();});
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I would recommend to make use of the events above. If you still don't see anything, it might be due to the fact, that the system performance is "too good". When calling
sap.ui.core.BusyIndicator.show(nDelay);
you can specify a delay in milliseconds. If you don't specify anything, a default value is taken (See API Reference)
Regards, Frank
Hi Loic,
I am facing the same problem. Can you please show me how can I use
with OModel.create().
I declare the busy dialog and use it like
BpModel.attachRequestSent(function(){busyDialog.open();});
BpModel.create('/CreateBP', oEntry, null, function(oResponse){
console.log(oResponse);
BpModel.attachRequestCompleted(function(){busyDialog.close();});
detBPDialog.open();
},
But the busy dialog is not appear. Can you please show me where I went wrong???
Thanks
Himadri
Try storing your oData model like: this.oModel
N then in Create calling -
function(uri,callback) {
this.requestSentEvent();
var fnResponse = {};
var that = this;
this.oServiceModel.read(uri, null, null, true,
function (oData, response) {
that.requestCompletedEvent();
callback.call(fnResponse);
},
function (oError) {
callback.call(fnResponse);
});
};
It is not getting the handle on oData model when it is completing the call.
Try this and let me know... if it is working
Thanks,
Chet
Hi everyone,
I'm facing an issue when using
"oModel.attachRequestSent()" and "oModel.attachRequestCompleted()".
When I click on my Save-Button, it takes 1-2sec. till the BusyDialog shows up.
This is because there is some stuff to do before the "create-request" is called.
The performance is very good, so the request needs only 1second till it's completed.
But I want the BusyDialog to show up right after I click the Save-Button.
I want to get a BusyDialog even for the 1-2sec till the "create-request" is fired.
So i decided to open the BusyDialog right after the Save-Button get's clicked.
But there's no BusyDialog coming up. With a breakpoint I'm able to see the Dialog.
Does anybody know what to do or how I can solve my issue?
Thanks and Greetz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Frank,
yes I tried to reduce the delay.
The Local Busy Indicator works but not as fast as I want it.
Is there a way to keep it opened for a few seconds?
I mean:
- BusyIndicator get's opened
- Close BusyIndicator when fired "attachRequestCompleted" but in any case be opened at least 3 seconds even the "attachRequestCompleted"-Event is fired after 1 second.
Regards,
Tobi
I am not sure what is gone wrong can u try similar to below piece of code
var loadData = function() {
busyDialog4.open()
oModel.create("/EintragMenge", oData, null,
function() {
jQuery.sap.require("sap.m.MessageToast");
sap.m.MessageToast.show("Done");
busyDialog4.close();
},
this.confirmTimeError()
);
}
Regards,
Ajain
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.