Hi all,
I did some research regarding preventing double clicking a button in Outsystems. This to avoid creating more than one records.
I mostly found solutions from a way back.
Does somebody know what is the best solution or best practice to solve this issue.
I found solutions like:
Solution 1
Exended Properties Button
onclick = "var e=this;setTimeout(function(){e.disabled=true;},0);return true;"
Solution 2
To disable the link, I gave a generic Class named (for instance) "PointerClass" to the link I was going to "disable/enable". Then, on the "onclick" extended property of the Link, I set:
"$('.PointerClass').css('pointer-events','none');"
To enable the Link again, I put a Javascript action at the end of the action called, with the code :
"$('.PointerClass').css('pointer-events','auto');"
Solution 3
Using this tiny JS
https://jsfiddle.net/joaomelont/0kLzhy1s/5/
The 1st solution was the easiest one for me. But it this also "best practice?
Or is there a better solution now? :)
Hi @Joao Vizela ,
I think the best way would be to use Button Loading widget. As it prevents the user to create multiple records by mistake(clicking multiple times) until loading is done.RegardsKrishnanand Pathak
Hi @Joao Vizela
Create a local variable of Boolean type i.e. EnableButton and set default value as True, and after click on button set EnableButton value to false and refresh the widget,
I hope it'll help you.
Thanks
Deep
Hello Guys,
This in my opinion is the most effective way in user interface.
Another alternative would be to ensure that identical records were not considered by the database, using Uniques in the target entity.
See this link:https://www.outsystems.com/forums/discussion/69401/how-to-ensure-unique-values/