Avoiding multiple submit with commandButton

UI Components for JSF
Post Reply
User avatar
MISS_DUKE
Posts: 273
Joined: 08 Aug 2010, 05:52

09 Oct 2010, 10:50

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)

crogenius
Posts: 20
Joined: 28 Apr 2010, 19:25

09 Oct 2010, 11:15

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

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

09 Oct 2010, 11:58

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

User avatar
MISS_DUKE
Posts: 273
Joined: 08 Aug 2010, 05:52

09 Oct 2010, 12:33

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)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests