Page 1 of 1

Avoiding multiple submit with commandButton

Posted: 09 Oct 2010, 10:50
by MISS_DUKE
What is the best method is to prevent multiple submit when using <p:commandButtom/>?

Any example Javascript code very much appreciated.

Re: Avoiding multiple submit with commandButton

Posted: 09 Oct 2010, 11:15
by crogenius
By my opinion and opinion of guys from guys from http://www.seznam.cz (it is one of the first and biggest Czech Republic portals) the Java Script preventing user action sux, because the user might have JS disabled. IMO the best way how to disable multiple submit is to keep hidden variable with some number, and check the number. When I use some command buttons, I alse use some entities with it(some editing ...) and when i need to edit entity, i use  @Version annotation for OptimisticLock. I think this might be the way

Re: Avoiding multiple submit with commandButton

Posted: 09 Oct 2010, 11:58
by cagatay.civici
There is no built-in solution for multiple submit, you can implement a token based server side solution. There are alternatives on the web.

Re: Avoiding multiple submit with commandButton

Posted: 09 Oct 2010, 12:33
by MISS_DUKE
There are alternatives on the web
If you specifically recommending or pointing some solutions, please post the links.