cancel
Showing results for 
Search instead for 
Did you mean: 

sapui5 button Multiple clicks at the same time!

0 Kudos

hi,everyone!do you meet this issue : if i Multiple clicks the button at the same time,it wiil call odata service repeatedly!!!how do you solve it?do something limit for the button?

Accepted Solutions (1)

Accepted Solutions (1)

feliperodrigues
Contributor

Hi Huang,

If your operation takes time and you need to block the user interaction while the OData call is going on you should use the Busy Dialog control to prevent any extra actions from the user, check the documentation below:

https://experience.sap.com/fiori-design-web/busydialog/

Busy Indicator can be used for specific UI controls but you should review both documentations to understand which one is more suitable for your scenario:

https://experience.sap.com/fiori-design-web/busy-indicator/

Hope this information helps.

Cheers,

Felipe

tanks Felipe de Mello Rodrigues!you did me a favor!!1

Answers (2)

Answers (2)

Hello,

Always include following code for avoiding Multi Clicks in custom action: oEvent.getSource().setEnabled(false);

//Again enable the button in success callback function and Error handling function

oEvent.getSource().setEnabled(true);

imsuryapandiyan
Participant
0 Kudos

Hi Huang,

You can disable the button and enable it in the success function of your oData call.

Or you can use busy indicator as Felipe has suggested.

Regards,

Suriya