cancel
Showing results for 
Search instead for 
Did you mean: 

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

meenakshi_raina
Advisor
Advisor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member340030
Contributor
0 Kudos

Hi Meenakshi Raina,

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

thanks

Viplove

meenakshi_raina
Advisor
Advisor
0 Kudos

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 ?

bblanckaert
Explorer
0 Kudos

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.

meenakshi_raina
Advisor
Advisor
0 Kudos

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 .

meenakshi_raina
Advisor
Advisor
0 Kudos

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

Thanks everyone for the support.

Answers (1)

Answers (1)

junwu
Active Contributor

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