Despite web pages having been around for quite some time, and users have been given years of affordance, people still double click on links & buttons in web pages.
This can cause a few issues in an APEX environment as the underlying process may get executed twice, and today I came up with what I thought was a simple, declarative solution.
In my case I had a button that submitted a modal page. I added a dynamic action that simply hid the button on click. I just had to ensure the action didn't execute on page load, and the button still submitted the page.
I thought I'd look around to see what others have done to mitigate this issue, and it seems I was on par, but with less code:
Wonderfully verbose description of what I described above
Purely session state protection
The only thing that makes me uncomfortable about my suggestion is the button has two behaviours, so Roeland's description may be considered more elegant, ie - a submit and hide action.