Re: Prevent double or more submissions.

2014-12-02 Thread Barry Books
This is the last form event so it's good for double click prevention. There are other form events that happen sooner. On Tuesday, December 2, 2014, Charlouze wrote: > @Barry: This is a good idea to use the prepareForSubmit event but it occurs > after validation so you have to have a fast validat

Re: Prevent double or more submissions.

2014-12-02 Thread Charlouze
@Barry: This is a good idea to use the prepareForSubmit event but it occurs after validation so you have to have a fast validation (which is the case for most of apps, mine included). 2014-12-02 12:29 GMT+01:00 Barry Books : > Here is the one I wrote for 5.4. It uses the perpareForSubmit form eve

Re: Prevent double or more submissions.

2014-12-02 Thread Barry Books
Here is the one I wrote for 5.4. It uses the perpareForSubmit form event define(["jquery","t5/core/events"], *function*($,events) { *return* *function*(parameters) { $('#'+parameters.id + ' :submit').removeAttr('disabled'); $('#'+parameters.id).bind(events.

Re: Prevent double or more submissions.

2014-12-02 Thread Charlouze
Thanks for the advice Thiago, you really are helpful for tapestry community ;) I'll do a patch for the validation error and create a JIRA with it. 2014-12-02 12:04 GMT+01:00 Thiago H de Paula Figueiredo : > On Tue, 02 Dec 2014 01:25:18 -0200, Charlouze wrote: > > @Thiago: I'd like to inform m

Re: Prevent double or more submissions.

2014-12-02 Thread Thiago H de Paula Figueiredo
On Tue, 02 Dec 2014 01:25:18 -0200, Charlouze wrote: @Thiago: I'd like to inform my user that the form is currently being sent (using an ajax request). That's why I need something similar to the clickOnce example. You can do that by adapting the example I provided. You've been actually askin

Re: Prevent double or more submissions.

2014-12-01 Thread Charlouze
@Thiago: I'd like to inform my user that the form is currently being sent (using an ajax request). That's why I need something similar to the clickOnce example. Do you think that adding a validation error event isn't a good idea anyway ? (It would probably serves other purpose for other people) @H

Re: Prevent double or more submissions.

2014-12-01 Thread Harry Zhou
Below is the source of a ClickOnce mixin I wrote for 5.4. Hopefully it helps. Note that the mixin should be applied to a element. 1. Trivial java class package some.package.name.mixins; // Insert package name. That "mixins" has to be there. import org.apache.tapestry5.ClientElement; import

Re: Prevent double or more submissions.

2014-12-01 Thread Thiago H de Paula Figueiredo
On Mon, 01 Dec 2014 16:05:02 -0200, Charlouze wrote: I'm not sure to understand what you mean... jumpstart example uses plain old js and does not work with tapestry client-side validation. I mean something like http://stackoverflow.com/questions/926816/how-to-prevent-form-from-submitting-mu

Re: Prevent double or more submissions.

2014-12-01 Thread Charlouze
I'm not sure to understand what you mean... jumpstart example uses plain old js and does not work with tapestry client-side validation. 2014-12-01 18:59 GMT+01:00 Thiago H de Paula Figueiredo : > Have you tried plain old JavaScript double form submission avoiding? > Anyway, you don't need to ove

Re: Prevent double or more submissions.

2014-12-01 Thread Thiago H de Paula Figueiredo
Have you tried plain old JavaScript double form submission avoiding? Anyway, you don't need to override anything from Tapestry's JS for that at all. On Mon, 01 Dec 2014 15:38:14 -0200, Charlouze wrote: Hey tapestry's users/gurus ! I need a way to prevent double form submission. I first ha

Prevent double or more submissions.

2014-12-01 Thread Charlouze
Hey tapestry's users/gurus ! I need a way to prevent double form submission. I first had a look at this example from jumpstart. As it is written, it conflicts with client-side form validation and I also need cl