51
Views
5
Comments
Solved
Prevent users from spam clicking buttons
Question
Application Type
Reactive

Hi Everyone,

What's the best approach to prevent users from spam clicking buttons when they think nothing is happening?

Thanks

2025-01-09 14-56-57
IQ78
Solution

use this button loading widget.


2022-01-13 11-06-04
Neha Sheikh
Champion

Hi JayPea,

Disable the button after first click. Use enable property of the button with Boolean variable.

Thanks,

Neha

2025-01-09 14-56-57
IQ78
Solution

use this button loading widget.


2022-09-04 15-01-10
JayPea

@ibox that's interesting.  Will this prevent spam clicking or is it just a visual indicator for the user that something is happening?

Do I need to use it in conjunction with enable button property?

2025-01-09 14-56-57
IQ78

I used this button to prevent user to double click... and so far so good, no need to disable the button.


If it is not enough, may be u can disable the button and enable only when she checks this:

regards

2022-11-16 10-07-10
Blane Thompson

As ibox has mentioned, you can (and should) use the Button Loading block provided by OutSystems UI. This takes in a boolean to indicate it is loading and will show a loading indicator on the button and also prevent further clicks until the boolean has been unset.

Make sure to set the boolean to True before running the server action, set it to False once the server action is completed. Make sure you also set it to False if there is a Communication Exception.



When migrating from regular buttons to ButtonLoading, you will see a div with the class osui-btn-loading__spinner-animation. This is the loading indicator that will show, make sure you keep this div else you will receive an error message when the widget is rendered. Within the block, there is also the input ShowLabelOnLoading, by default OutSystemsUI will hide the text and only show the loading indicator but I recommend keeping the Label on load.

For my projects, I made another block that uses ButtonLoading, defaults ShowLabelOnLoading to True and also does not immediately show the loading indicator (to prevent a content flash).

ServiceStudio_hoiB5OhcQt.png
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.