Skip to Content
0

​How to keep control on web page while the code is executed at ECC end ?

Jun 28, 2017 at 05:40 AM

104

avatar image

Hi All,

I have a dialog box in my sap UI5 web page. When a user clicks on a button( say OK) in the dialog box, the control passes over to DPC class where some code execution takes place. It takes around 2-4 seconds for the code execution at ECC end.

Meanwhile, if the user again clicks on OK button, the other items in my screen are also executed. Is there a way, where clicking on the button is no longer possible until the execution at ECC end completes.

Kindly suggest.

Thanks

Meenakshi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
VIPLOVE KHUSHALANI Jun 28, 2017 at 08:42 AM
0

Hi Meenakshi Raina,

Put a busy indicator sap.ui.core.BusyIndicator.show(0) till the request is processed .

thanks

Viplove

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi @VIPLOVE KHUSHALANI

Thanks for the reply. Where should I use this indicator ?

var oButton9 = new sap.m.Button("Waive1", { text: "OK", press: [oController.Execution, oController] });

or

in the method ?

execute-button.png (23.5 kB)
0

If you still want to allow the user to make changes to the dialog, then you can use the setBusy() method on the button.

e.g. before you call the create on your oModel, call oEvent.getSource().setBusy(true);

Then in the success and error callback functions, use sap.ui.getCore().byId("Waive1").setBusy(false);

Or you can use the sap.ui.core.BusyIndicator.show() and sap.ui.core.BusyIndicator.hide() if you want to block the entire screen.

0

Hi,

I have used busydialog in my create request on the oModel. But it is working only in debug mode, but not normally. Hence, in my create operation, I tried to set an asynchronous property as "true". Still the busydialog is not appearing. Can anyone please help me with it .

busydialog.png (24.3 kB)
0

Thanks. I used setTimeout(function() { } and now it is working properly

Thanks everyone for the support.

0
Jun Wu Jun 28, 2017 at 06:26 AM
1

disable the button when you make call to backend, enable it when the call is finished

Share
10 |10000 characters needed characters left characters exceeded