Re: prevent multiple form submits
Sounds like a bug although I don't understand yet why it would not work. Please open an issue. On Jan 27, 2012, at 10:11 PM, Yohan Yudanara wrote: > Thank you for your fast reply :) > > First, I want to say sorry because I'm copy pasting your > DisableAfterSubmit.java and DisableAfterSubmit.js. > When I was trying to use whole flowlogix library, I have difficulties fix > my pom.xml because many dependencies required by flowlogix when I run "mvn > jetty:run". > > Ok, back to the topic.. :) > Yup, the popup validation is not showing up when I clicked submit button. > The popup only shown when I move away from text field. > > I've try with simple page: > > > Input Name: > > > > And this is the page class: > public class TestPage { > @Property > private String name; > void onValidateFromForm() { > System.out.println("ONVALIDATE TRIGGERED"); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > } > } > > When I use mixins, the client validation / popup is shown when I move away > from textfield, but the popup doesn't show when I clicked submit button: > > > When I remove the mixins, the client validation works when I clicked submit > button. > > > Thanks in advance.. > > Best regards, > Yohan Yudanara > > On Sat, Jan 28, 2012 at 3:25 AM, Lenny Primak wrote: > >> As I said before i never did extensive tests with client validation, but >> it should work. >> What exactly isn't working? Are the popups not showing up? >> Is it working differently if the mixin isn't there? >> Can you post your template / code? And if you really think this is a bug >> feel free to open an issue against it as well. >> >> >> On Jan 27, 2012, at 10:10 AM, Yohan Yudanara >> wrote: >> >>> I'm sorry to resurrect this thread :) >>> >>> I've tried DisableAfterSubmit with Tapestry 5.3.1, it works great. >>> But the client side validation is not working. It seems client side >>> validation is not triggered at all when I'm using DisableAfterSubmit >> mixins. >>> Did you also having the same experience ? or did the client validation >>> supposed to work? >>> >>> Thanks in advance... >>> >>> On Tue, Nov 22, 2011 at 5:59 AM, Lenny Primak >> wrote: >>> I just did a quick test with form/zone/clientValidations and the mixin works correctly. On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: > I see... > I actually never tried forms with client-side validation with the >> mixin. > If it doesn't work, please feel free to submit an issue, even better a patch with tests, if required. > > > On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: > >> sorry , still confused, in your code , you bind click event , but when it's a link submit , you click it , if has a client validation >> error , it will still submit? >> >> thanks for you patient. >> >> On 2011年11月22日 06:02, Lenny Primak wrote: >>> It's _after_ submit. It doesn't have to do anything with validation. >>> >>> > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Thank you for your fast reply :) First, I want to say sorry because I'm copy pasting your DisableAfterSubmit.java and DisableAfterSubmit.js. When I was trying to use whole flowlogix library, I have difficulties fix my pom.xml because many dependencies required by flowlogix when I run "mvn jetty:run". Ok, back to the topic.. :) Yup, the popup validation is not showing up when I clicked submit button. The popup only shown when I move away from text field. I've try with simple page: Input Name: And this is the page class: public class TestPage { @Property private String name; void onValidateFromForm() { System.out.println("ONVALIDATE TRIGGERED"); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } } } When I use mixins, the client validation / popup is shown when I move away from textfield, but the popup doesn't show when I clicked submit button: When I remove the mixins, the client validation works when I clicked submit button. Thanks in advance.. Best regards, Yohan Yudanara On Sat, Jan 28, 2012 at 3:25 AM, Lenny Primak wrote: > As I said before i never did extensive tests with client validation, but > it should work. > What exactly isn't working? Are the popups not showing up? > Is it working differently if the mixin isn't there? > Can you post your template / code? And if you really think this is a bug > feel free to open an issue against it as well. > > > On Jan 27, 2012, at 10:10 AM, Yohan Yudanara > wrote: > > > I'm sorry to resurrect this thread :) > > > > I've tried DisableAfterSubmit with Tapestry 5.3.1, it works great. > > But the client side validation is not working. It seems client side > > validation is not triggered at all when I'm using DisableAfterSubmit > mixins. > > Did you also having the same experience ? or did the client validation > > supposed to work? > > > > Thanks in advance... > > > > On Tue, Nov 22, 2011 at 5:59 AM, Lenny Primak >wrote: > > > >> I just did a quick test with form/zone/clientValidations and the mixin > >> works correctly. > >> > >> On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: > >> > >>> I see... > >>> I actually never tried forms with client-side validation with the > mixin. > >>> If it doesn't work, please feel free to submit an issue, even better a > >> patch with tests, if required. > >>> > >>> > >>> On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: > >>> > sorry , still confused, in your code , you bind click event , but > >> when it's a link submit , you click it , if has a client validation > error , > >> it will still submit? > > thanks for you patient. > > On 2011年11月22日 06:02, Lenny Primak wrote: > > It's _after_ submit. It doesn't have to do anything with validation. > > > > > >>> > >> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> For additional commands, e-mail: users-h...@tapestry.apache.org > >> > >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: prevent multiple form submits
As I said before i never did extensive tests with client validation, but it should work. What exactly isn't working? Are the popups not showing up? Is it working differently if the mixin isn't there? Can you post your template / code? And if you really think this is a bug feel free to open an issue against it as well. On Jan 27, 2012, at 10:10 AM, Yohan Yudanara wrote: > I'm sorry to resurrect this thread :) > > I've tried DisableAfterSubmit with Tapestry 5.3.1, it works great. > But the client side validation is not working. It seems client side > validation is not triggered at all when I'm using DisableAfterSubmit mixins. > Did you also having the same experience ? or did the client validation > supposed to work? > > Thanks in advance... > > On Tue, Nov 22, 2011 at 5:59 AM, Lenny Primak wrote: > >> I just did a quick test with form/zone/clientValidations and the mixin >> works correctly. >> >> On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: >> >>> I see... >>> I actually never tried forms with client-side validation with the mixin. >>> If it doesn't work, please feel free to submit an issue, even better a >> patch with tests, if required. >>> >>> >>> On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: >>> sorry , still confused, in your code , you bind click event , but >> when it's a link submit , you click it , if has a client validation error , >> it will still submit? thanks for you patient. On 2011年11月22日 06:02, Lenny Primak wrote: > It's _after_ submit. It doesn't have to do anything with validation. > > >>> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
I'm sorry to resurrect this thread :) I've tried DisableAfterSubmit with Tapestry 5.3.1, it works great. But the client side validation is not working. It seems client side validation is not triggered at all when I'm using DisableAfterSubmit mixins. Did you also having the same experience ? or did the client validation supposed to work? Thanks in advance... On Tue, Nov 22, 2011 at 5:59 AM, Lenny Primak wrote: > I just did a quick test with form/zone/clientValidations and the mixin > works correctly. > > On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: > > > I see... > > I actually never tried forms with client-side validation with the mixin. > > If it doesn't work, please feel free to submit an issue, even better a > patch with tests, if required. > > > > > > On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: > > > >> sorry , still confused, in your code , you bind click event , but > when it's a link submit , you click it , if has a client validation error , > it will still submit? > >> > >> thanks for you patient. > >> > >> On 2011年11月22日 06:02, Lenny Primak wrote: > >>> It's _after_ submit. It doesn't have to do anything with validation. > >>> > >>> > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: prevent multiple form submits
Submitted JIRA case 2787 w/ code. On Mon, Nov 21, 2011 at 8:21 PM, hongdengdao wrote: > great !! > thanks for sharing!! > > > On 2011年11月22日 06:59, Lenny Primak wrote: > >> I just did a quick test with form/zone/clientValidations and the mixin >> works correctly. >> >> On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: >> >> I see... >>> I actually never tried forms with client-side validation with the mixin. >>> If it doesn't work, please feel free to submit an issue, even better a >>> patch with tests, if required. >>> >>> >>> On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: >>> >>> sorry , still confused, in your code , you bind click event , but when it's a link submit , you click it , if has a client validation error , it will still submit? thanks for you patient. On 2011年11月22日 06:02, Lenny Primak wrote: > It's _after_ submit. It doesn't have to do anything with validation. > > > >> --**--**- >> To unsubscribe, e-mail: >> users-unsubscribe@tapestry.**apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > --**--**- > To unsubscribe, e-mail: > users-unsubscribe@tapestry.**apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: prevent multiple form submits
great !! thanks for sharing!! On 2011年11月22日 06:59, Lenny Primak wrote: I just did a quick test with form/zone/clientValidations and the mixin works correctly. On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: I see... I actually never tried forms with client-side validation with the mixin. If it doesn't work, please feel free to submit an issue, even better a patch with tests, if required. On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: sorry , still confused, in your code , you bind click event , but when it's a link submit , you click it , if has a client validation error , it will still submit? thanks for you patient. On 2011年11月22日 06:02, Lenny Primak wrote: It's _after_ submit. It doesn't have to do anything with validation. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
On Mon, 21 Nov 2011 22:27:50 -0200, Ray Nicholus wrote: Thiago or Howard:Is there any chance Tapestry will natively prevent multiple form submissions in a future version? Adding it as a default behavior may not be the best option, specially with a JavaScript-only solution. On the other hand, adding it as a parameter in Form or as a mixin sounds good, as it would provide the feature without changing the past default behavior. Post a JIRA asking for it. If it includes some code (we won't use Lenny's without permission) and tests (no tests, no commit), better yet. ;) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Thiago or Howard:Is there any chance Tapestry will natively prevent multiple form submissions in a future version? On Mon, Nov 21, 2011 at 4:59 PM, Lenny Primak wrote: > I just did a quick test with form/zone/clientValidations and the mixin > works correctly. > > On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: > > > I see... > > I actually never tried forms with client-side validation with the mixin. > > If it doesn't work, please feel free to submit an issue, even better a > patch with tests, if required. > > > > > > On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: > > > >> sorry , still confused, in your code , you bind click event , but > when it's a link submit , you click it , if has a client validation error , > it will still submit? > >> > >> thanks for you patient. > >> > >> On 2011年11月22日 06:02, Lenny Primak wrote: > >>> It's _after_ submit. It doesn't have to do anything with validation. > >>> > >>> > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: prevent multiple form submits
I just did a quick test with form/zone/clientValidations and the mixin works correctly. On Nov 21, 2011, at 5:45 PM, Lenny Primak wrote: > I see... > I actually never tried forms with client-side validation with the mixin. > If it doesn't work, please feel free to submit an issue, even better a patch > with tests, if required. > > > On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: > >> sorry , still confused, in your code , you bind click event , but when >> it's a link submit , you click it , if has a client validation error , it >> will still submit? >> >> thanks for you patient. >> >> On 2011年11月22日 06:02, Lenny Primak wrote: >>> It's _after_ submit. It doesn't have to do anything with validation. >>> >>> > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
I see... I actually never tried forms with client-side validation with the mixin. If it doesn't work, please feel free to submit an issue, even better a patch with tests, if required. On Nov 21, 2011, at 5:15 PM, hongdengdao wrote: > sorry , still confused, in your code , you bind click event , but when it's > a link submit , you click it , if has a client validation error , it will > still submit? > > thanks for you patient. > > On 2011年11月22日 06:02, Lenny Primak wrote: >> It's _after_ submit. It doesn't have to do anything with validation. >> >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
sorry , still confused, in your code , you bind click event , but when it's a link submit , you click it , if has a client validation error , it will still submit? thanks for you patient. On 2011年11月22日 06:02, Lenny Primak wrote: It's _after_ submit. It doesn't have to do anything with validation. On Nov 21, 2011, at 4:57 PM, hongdengdao wrote: when validate failed, disable or enable? On 2011年11月22日 05:39, François Facon wrote: Nice Work Lenny. I just discovered your mixin http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java And his related prototype file http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js 2011/11/21 Lenny Primak: Perhaps there are better solutions, but I solved it via DisableAfterSubmit mixin in my FlowLogix utility module http://code.google.com/p/flowlogix/ On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: I'm sure I am not the first one to encounter this problem, and before I go about re-inventing the wheel, I wanted to see if this is something that has already been elegantly solved in the tapestry circle. Anyone? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Sure I'd like to contribute. Gotta work on that documentation and there are other generic things in there that would be useful in tapestry-core. On Nov 21, 2011, at 5:09 PM, "Thiago H. de Paula Figueiredo" wrote: > On Mon, 21 Nov 2011 19:39:49 -0200, François Facon > wrote: > >> Nice Work Lenny. > > Agreed. :) Would you like to have it included in Tapestry-core? ;-) You can > always donate if you want. ;) > >> I just discovered your mixin >> http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java >> >> And his related prototype file >> http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js > > Cheers! > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
On Mon, 21 Nov 2011 19:39:49 -0200, François Facon wrote: Nice Work Lenny. Agreed. :) Would you like to have it included in Tapestry-core? ;-) You can always donate if you want. ;) I just discovered your mixin http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java And his related prototype file http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js Cheers! -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
I'm wondering if tapestry should natively prevent multiple submits instead. That way, we won't need a mixin. This seems like a good idea, unless there is some case where multiple submits would be desirable, but I can't think of any. On Mon, Nov 21, 2011 at 3:56 PM, Lenny Primak wrote: > Multiple submits are allowed in the mixin. Perhaps I am misunderstood your > us case. > > > > On Nov 21, 2011, at 4:51 PM, Ray Nicholus wrote: > > > Looks interesting, and I do think a mixin is a good way to go here. > > However, I'm trying to think of a case where multiple submits would be > > permissible. If there is no such case, perhaps it would be ideal for > this > > to be handled naively by Tapestry. Has there been any discussion along > > these lines? > > > > 2011/11/21 François Facon > > > >> Nice Work Lenny. > >> > >> I just discovered your mixin > >> > >> > http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java > >> > >> And his related prototype file > >> > >> > http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js > >> > >> > >> > >> 2011/11/21 Lenny Primak : > >>> Perhaps there are better solutions, but I solved it via > >> DisableAfterSubmit mixin in my FlowLogix utility module > >> http://code.google.com/p/flowlogix/ > >>> > >>> On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: > >>> > I'm sure I am not the first one to encounter this problem, and before > I > >> go > about re-inventing the wheel, I wanted to see if this is something > that > >> has > already been elegantly solved in the tapestry circle. Anyone? > >>> > >>> > >>> - > >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >>> For additional commands, e-mail: users-h...@tapestry.apache.org > >>> > >>> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> For additional commands, e-mail: users-h...@tapestry.apache.org > >> > >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: prevent multiple form submits
It's _after_ submit. It doesn't have to do anything with validation. On Nov 21, 2011, at 4:57 PM, hongdengdao wrote: > when validate failed, disable or enable? > > On 2011年11月22日 05:39, François Facon wrote: >> Nice Work Lenny. >> >> I just discovered your mixin >> http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java >> >> And his related prototype file >> http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js >> >> >> >> 2011/11/21 Lenny Primak: >>> Perhaps there are better solutions, but I solved it via DisableAfterSubmit >>> mixin in my FlowLogix utility module http://code.google.com/p/flowlogix/ >>> >>> On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: >>> I'm sure I am not the first one to encounter this problem, and before I go about re-inventing the wheel, I wanted to see if this is something that has already been elegantly solved in the tapestry circle. Anyone? >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
when validate failed, disable or enable? On 2011年11月22日 05:39, François Facon wrote: Nice Work Lenny. I just discovered your mixin http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java And his related prototype file http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js 2011/11/21 Lenny Primak: Perhaps there are better solutions, but I solved it via DisableAfterSubmit mixin in my FlowLogix utility module http://code.google.com/p/flowlogix/ On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: I'm sure I am not the first one to encounter this problem, and before I go about re-inventing the wheel, I wanted to see if this is something that has already been elegantly solved in the tapestry circle. Anyone? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Multiple submits are allowed in the mixin. Perhaps I am misunderstood your us case. On Nov 21, 2011, at 4:51 PM, Ray Nicholus wrote: > Looks interesting, and I do think a mixin is a good way to go here. > However, I'm trying to think of a case where multiple submits would be > permissible. If there is no such case, perhaps it would be ideal for this > to be handled naively by Tapestry. Has there been any discussion along > these lines? > > 2011/11/21 François Facon > >> Nice Work Lenny. >> >> I just discovered your mixin >> >> http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java >> >> And his related prototype file >> >> http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js >> >> >> >> 2011/11/21 Lenny Primak : >>> Perhaps there are better solutions, but I solved it via >> DisableAfterSubmit mixin in my FlowLogix utility module >> http://code.google.com/p/flowlogix/ >>> >>> On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: >>> I'm sure I am not the first one to encounter this problem, and before I >> go about re-inventing the wheel, I wanted to see if this is something that >> has already been elegantly solved in the tapestry circle. Anyone? >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
er natively, not naively. On Mon, Nov 21, 2011 at 3:51 PM, Ray Nicholus wrote: > Looks interesting, and I do think a mixin is a good way to go here. > However, I'm trying to think of a case where multiple submits would be > permissible. If there is no such case, perhaps it would be ideal for this > to be handled naively by Tapestry. Has there been any discussion along > these lines? > > > 2011/11/21 François Facon > >> Nice Work Lenny. >> >> I just discovered your mixin >> >> http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java >> >> And his related prototype file >> >> http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js >> >> >> >> 2011/11/21 Lenny Primak : >> > Perhaps there are better solutions, but I solved it via >> DisableAfterSubmit mixin in my FlowLogix utility module >> http://code.google.com/p/flowlogix/ >> > >> > On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: >> > >> >> I'm sure I am not the first one to encounter this problem, and before >> I go >> >> about re-inventing the wheel, I wanted to see if this is something >> that has >> >> already been elegantly solved in the tapestry circle. Anyone? >> > >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> > For additional commands, e-mail: users-h...@tapestry.apache.org >> > >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >
Re: prevent multiple form submits
Looks interesting, and I do think a mixin is a good way to go here. However, I'm trying to think of a case where multiple submits would be permissible. If there is no such case, perhaps it would be ideal for this to be handled naively by Tapestry. Has there been any discussion along these lines? 2011/11/21 François Facon > Nice Work Lenny. > > I just discovered your mixin > > http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java > > And his related prototype file > > http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js > > > > 2011/11/21 Lenny Primak : > > Perhaps there are better solutions, but I solved it via > DisableAfterSubmit mixin in my FlowLogix utility module > http://code.google.com/p/flowlogix/ > > > > On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: > > > >> I'm sure I am not the first one to encounter this problem, and before I > go > >> about re-inventing the wheel, I wanted to see if this is something that > has > >> already been elegantly solved in the tapestry circle. Anyone? > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: prevent multiple form submits
Thanks for the kind words Francois, although the documentation is still desperately lacking. On Nov 21, 2011, at 4:39 PM, François Facon wrote: > Nice Work Lenny. > > I just discovered your mixin > http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java > > And his related prototype file > http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js > > > > 2011/11/21 Lenny Primak : >> Perhaps there are better solutions, but I solved it via DisableAfterSubmit >> mixin in my FlowLogix utility module http://code.google.com/p/flowlogix/ >> >> On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: >> >>> I'm sure I am not the first one to encounter this problem, and before I go >>> about re-inventing the wheel, I wanted to see if this is something that has >>> already been elegantly solved in the tapestry circle. Anyone? >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Nice Work Lenny. I just discovered your mixin http://code.google.com/p/flowlogix/source/browse/services/src/main/java/com/flowlogix/web/mixins/DisableAfterSubmit.java And his related prototype file http://code.google.com/p/flowlogix/source/browse/services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js 2011/11/21 Lenny Primak : > Perhaps there are better solutions, but I solved it via DisableAfterSubmit > mixin in my FlowLogix utility module http://code.google.com/p/flowlogix/ > > On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: > >> I'm sure I am not the first one to encounter this problem, and before I go >> about re-inventing the wheel, I wanted to see if this is something that has >> already been elegantly solved in the tapestry circle. Anyone? > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Perhaps there are better solutions, but I solved it via DisableAfterSubmit mixin in my FlowLogix utility module http://code.google.com/p/flowlogix/ On Nov 21, 2011, at 4:07 PM, Ray Nicholus wrote: > I'm sure I am not the first one to encounter this problem, and before I go > about re-inventing the wheel, I wanted to see if this is something that has > already been elegantly solved in the tapestry circle. Anyone? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: prevent multiple form submits
Have a look at Jumpstart. http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/creatingmixins1 2011/11/21 Ray Nicholus : > I'm sure I am not the first one to encounter this problem, and before I go > about re-inventing the wheel, I wanted to see if this is something that has > already been elegantly solved in the tapestry circle. Anyone? > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
prevent multiple form submits
I'm sure I am not the first one to encounter this problem, and before I go about re-inventing the wheel, I wanted to see if this is something that has already been elegantly solved in the tapestry circle. Anyone?
Re: [T5] Prevent multiple form submits
I have an error in the second listener. It should be like this: document.observe(Tapestry.TRIGGER_ZONE_UPDATE_EVENT, function(event) { var element = event.findElement(); var zoneManager = Tapestry.findZoneManager(element); K12.showLoading(zoneManager.element); }); Regards, Raul. -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-Prevent-multiple-form-submits-tp5477609p5484072.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Prevent multiple form submits
For example, you can listen to Tapestry.FORM_PROCESS_SUBMIT_EVENT to show the div over the form, and then listen to Tapestry.ZONE_UPDATED_EVENT (this is fired when you update the content of a Zone). In order to put an overlay in all Zones, either associated with forms or with links, you can observe this two events: document.observe(Tapestry.FORM_PROCESS_SUBMIT_EVENT, function(event) { var form = event.findElement(); var zoneManager = Tapestry.findZoneManager(form); K12.showLoading(zoneManager.element); }); document.observe(Tapestry.TRIGGER_ZONE_UPDATE_EVENT, function(event) { var zone = event.findElement(); K12.showLoading(zone.element); }); Where K12.showLoading() creates or shows this overlay. To remove the overlay, in most cases you can use the Tapestry.ZONE_UPDATED_EVENT event, but this doesn't work well if your event response from the server uses a MultiZoneUpdate (because this will trigger Tapestry.ZONE_UPDATED_EVENT on every updated Zone and maybe that doesn't include the Zone associated with the initial update trigger). So, what I did was to decorate the method where the requesting Zone process the reply: (function() { Tapestry.ZoneManager.addMethods({ processReply: Tapestry.ZoneManager.prototype.processReply.wrap(function(proceed, reply){ proceed(reply); K12.hideLoading(this.element); }) }); })(); in K12.hideLoading() I hide (or remove if you want to) the created overlay (which is stored in a property inside the Tapestry object of the element ( $T(element) ) ). I didn't like it too much to decorate this method, but it was the better way I found. If anybody has a better way, please share :) Regards, Raul. -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-Prevent-multiple-form-submits-tp5477609p5484015.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Prevent multiple form submits
I am wondering how I should handle ajax form submit. ClickOnce looks neat but looks like it wouldn't work for that, and it looks like it might break with client side validation too. I think I can see the events I need to observe now, although I'm wondering how to hide my div again after an ajax submit completes (or whether I should even show it for those forms). Wonder if a form has it's zone in $T()... -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-Prevent-multiple-form-submits-tp5477609p5482199.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Prevent multiple form submits
I don't know if I understand correctly your problem, but Tapestry fires some JavaScript events when the form is submitting (see tapestry.js for details), like Tapestry.FORM_VALIDATE_EVENT, Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT and Tapestry.FORM_PROCESS_SUBMIT_EVENT. The latter two fire after validation, so they are good to block another submission after the form has passed validation and it is ready to submit. Regards, Raul. P.S.: I use Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT to update a field converted to TinyMCE, specially for Ajax submits (because it updates the field automatically only on normal submits). -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-Prevent-multiple-form-submits-tp5477609p5478598.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Prevent multiple form submits
Have a look at this example (if javascript is an option): http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/creatingmixins1 Sigbjørn Tvedt On Mon, Aug 30, 2010 at 1:57 PM, joris wrote: > Yes, the client validation is the biggest problem. I tried something > similar. I disable the submit button for 2 seconds, to work around the > client site validation problem. I get it work for IE and Firefox, but in > Chrome it doesn't work. > > Event.observe(window, 'load', function() { >$$("input[type=submit]").each(function(submit) { >Event.observe(submit, 'click', function() { >submit.disable(); > window.setTimeout(function() { > submit.enable(); > }, 2000); > if(Prototype.Browser.IE){ > submit.form.submit(); > } >}); >}); > }); > > > Am Montag, den 30.08.2010, 04:14 -0700 schrieb LLTYK: > > I have a hidden div with a "Processing" message, then I listen for submit > > events and pop the div into view, blocking off the page until it > redirects. > > Although I haven't figured out how to get to mesh will with client side > > validation, where I'd get an event but the form would not submit due to > an > > error (probably listening to wrong event). > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: [T5] Prevent multiple form submits
Yes, the client validation is the biggest problem. I tried something similar. I disable the submit button for 2 seconds, to work around the client site validation problem. I get it work for IE and Firefox, but in Chrome it doesn't work. Event.observe(window, 'load', function() { $$("input[type=submit]").each(function(submit) { Event.observe(submit, 'click', function() { submit.disable(); window.setTimeout(function() { submit.enable(); }, 2000); if(Prototype.Browser.IE){ submit.form.submit(); } }); }); }); Am Montag, den 30.08.2010, 04:14 -0700 schrieb LLTYK: > I have a hidden div with a "Processing" message, then I listen for submit > events and pop the div into view, blocking off the page until it redirects. > Although I haven't figured out how to get to mesh will with client side > validation, where I'd get an event but the form would not submit due to an > error (probably listening to wrong event). - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Prevent multiple form submits
I have a hidden div with a "Processing" message, then I listen for submit events and pop the div into view, blocking off the page until it redirects. Although I haven't figured out how to get to mesh will with client side validation, where I'd get an event but the form would not submit due to an error (probably listening to wrong event). -- View this message in context: http://tapestry-users.832.n2.nabble.com/T5-Prevent-multiple-form-submits-tp5477609p5477739.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5] Prevent multiple form submits
Hello, I try to prevent multiple form submits, if the user clicks more then ones a submit button. Is there a build in way for this problem? Or is there a preferred solution? Thanks. Joris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org