Board index JavaServer Faces General Avoiding multiple submit with commandButton

Avoiding multiple submit with commandButton

Components, Ajax Framework, Utilities and More.


Posts: 273
What is the best method is to prevent multiple submit when using <p:commandButtom/>?

Any example Javascript code very much appreciated.
JSF implementation: Mojarra V2.1.7
JSF component library: Primefaces V3.1.1
Server: GlassFish Open Source Edition V3.1.1 (build 12)


Posts: 20
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
NetBeans 6.9
JSF 2.0
GlassFish v 3
PrimeFaces 2.2.M1


Posts: 14905
Location: Cybertron

There is no built-in solution for multiple submit, you can implement a token based server side solution. There are alternatives on the web.
PrimeFaces Lead


Posts: 273
There are alternatives on the web


If you specifically recommending or pointing some solutions, please post the links.
JSF implementation: Mojarra V2.1.7
JSF component library: Primefaces V3.1.1
Server: GlassFish Open Source Edition V3.1.1 (build 12)


Return to General