[T5] Dirty Form checking?
How can I do dirty form checking in T5? Can anybody who has done this share a little bit? Thank you.
Re: dirty form checking ...
Jesse recently fixed https://issues.apache.org/jira/browse/TAPESTRY-1245 Did you get a chance to try the dirty form checker again? [EMAIL PROTECTED] wrote: Ok, now I got it right, almost ;). Somehow tapestry tapestry.form.onFormSubmit is not called, when you use tapestry.form.submit to submit the form, as @LinkSubmit does. So I ended up with two connections for the defuser: dojo.event.connect("before", tapestry.form ,"onFormSubmit", tapestry.dirtyFormWarning, "defuse"); dojo.event.connect("around", tapestry.form,"submit", tapestry.dirtyFormWarning, "defuseAround"); Now, this works fine for FF out of the box. However there's an issue with (surprise, surprise) IE, which fires onbeforeunload twice under certain circumstances, the first time being before one has a chance to defuse the warning component. Afaik, this occurs only with the idiom as it is used in @LinkSubmit. I have therefore in our app replaced @LinkSubmit with an equivalent component whiche renders ... instead of ... So, for this component to be useful for Tacos, tapestry's LinkSubmit would have to be changed accordingly. Andy has already submitted a jira for this, I see: https://issues.apache.org/jira/browse/TAPESTRY-1245 regards, Marcus Ok, I tried dojo.event.connect( tapestry.form ,"onFormSubmit",tapestry.dirtyFormWarning, "defuse"); now, same result: works for @Submit, doesn't work for @LinkSubmit ... -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 09, 2007 5:52 PM To: Tapestry users Subject: Re: dirty form checking ... I think you can connect to tapestry.form.onFormSubmit as per: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry -framework/src/js/tapestry/form.js?view=markup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dirty form checking ...
Ok, now I got it right, almost ;). Somehow tapestry tapestry.form.onFormSubmit is not called, when you use tapestry.form.submit to submit the form, as @LinkSubmit does. So I ended up with two connections for the defuser: dojo.event.connect("before", tapestry.form ,"onFormSubmit", tapestry.dirtyFormWarning, "defuse"); dojo.event.connect("around", tapestry.form,"submit", tapestry.dirtyFormWarning, "defuseAround"); Now, this works fine for FF out of the box. However there's an issue with (surprise, surprise) IE, which fires onbeforeunload twice under certain circumstances, the first time being before one has a chance to defuse the warning component. Afaik, this occurs only with the idiom as it is used in @LinkSubmit. I have therefore in our app replaced @LinkSubmit with an equivalent component whiche renders ... instead of ... So, for this component to be useful for Tacos, tapestry's LinkSubmit would have to be changed accordingly. Andy has already submitted a jira for this, I see: https://issues.apache.org/jira/browse/TAPESTRY-1245 regards, Marcus > > Ok, I tried > dojo.event.connect( tapestry.form > ,"onFormSubmit",tapestry.dirtyFormWarning, "defuse"); now, > same result: works for @Submit, doesn't work for @LinkSubmit ... > > > > -Original Message- > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, May 09, 2007 5:52 PM > > To: Tapestry users > > Subject: Re: dirty form checking ... > > > > I think you can connect to tapestry.form.onFormSubmit as per: > > > > http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry > > -framework/src/js/tapestry/form.js?view=markup > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dirty form checking ...
> And hey, if that works, perhaps contribute back into tacos? > > i'm sure we'll have to implement that eventually, so it'll be > a huge shortcut if we could use that! sure, if I ever make it work ... :( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dirty form checking ...
Ok, I tried dojo.event.connect( tapestry.form ,"onFormSubmit",tapestry.dirtyFormWarning, "defuse"); now, same result: works for @Submit, doesn't work for @LinkSubmit ... > -Original Message- > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 09, 2007 5:52 PM > To: Tapestry users > Subject: Re: dirty form checking ... > > I think you can connect to tapestry.form.onFormSubmit as per: > > http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry > -framework/src/js/tapestry/form.js?view=markup > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Yes, that's what I started with. > > The basic check works, now. But I can't seem to hook into regular > > form-submission nicely, to switch off the dirty-check in that case. > > I tried > > > > > dojo.event.connect(form_${formName},"onsubmit",tapestry.dirtyFormWarni > > ng > > , "defuse"); > > > > That works just fine for @Submit, but not at all for > @LinkSubmit ... . > > > > > -----Original Message- > > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, May 09, 2007 3:53 PM > > > To: Tapestry users > > > Subject: Re: dirty form checking ... > > > > > > Oh ...Forgot that you wanted to stop it. Yeah that wouldn't work > > > there. > > > > > > I don't think there is anything to do other than what tacos does: > > > > > > http://opencomponentry.com:8080/tacos/forms/DirtyFormExample.html > > > > > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > > thanks, but I don't seem to be able to veto that event. > > > > dojo.event.browser.stopEvent(evt) doesn't seem to work ... > > > > > > > > > -Original Message- > > > > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > > > > Sent: Wednesday, May 09, 2007 2:57 PM > > > > > To: Tapestry users > > > > > Subject: Re: dirty form checking ... > > > > > > > > > > dojo.addOnUnload > > > > > > > > > > On 5/9/07, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > I'm implementing a dirty form checking component. > > > > > > > > > > > > Can I avoid the dreaded window.onbeforeunload and use some > > > > > convenient > > > > > > dojo-hook to upon unloading the form? > > > > > > > > > > > > Any ideas are welcome! > > > > > > > > > > > > thanks, Marcus > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Jesse Kuhnert > > > > > Tapestry/Dojo team member/developer > > > > > > > > > > Open source based consulting work centered around > > > > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > > > > > > > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > Jesse Kuhnert > > > Tapestry/Dojo team member/developer > > > > > > Open source based consulting work centered around > > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Jesse Kuhnert > Tapestry/Dojo team member/developer > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dirty form checking ...
And hey, if that works, perhaps contribute back into tacos? i'm sure we'll have to implement that eventually, so it'll be a huge shortcut if we could use that! On 5/9/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote: I think you can connect to tapestry.form.onFormSubmit as per: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form.js?view=markup On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Yes, that's what I started with. > The basic check works, now. But I can't seem to hook into regular > form-submission nicely, to switch > off the dirty-check in that case. > I tried > > dojo.event.connect(form_${formName},"onsubmit",tapestry.dirtyFormWarning > , "defuse"); > > That works just fine for @Submit, but not at all for @LinkSubmit ... . > > > -Original Message- > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, May 09, 2007 3:53 PM > > To: Tapestry users > > Subject: Re: dirty form checking ... > > > > Oh ...Forgot that you wanted to stop it. Yeah that wouldn't > > work there. > > > > I don't think there is anything to do other than what tacos does: > > > > http://opencomponentry.com:8080/tacos/forms/DirtyFormExample.html > > > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > thanks, but I don't seem to be able to veto that event. > > > dojo.event.browser.stopEvent(evt) doesn't seem to work ... > > > > > > > -Original Message- > > > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > > > Sent: Wednesday, May 09, 2007 2:57 PM > > > > To: Tapestry users > > > > Subject: Re: dirty form checking ... > > > > > > > > dojo.addOnUnload > > > > > > > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > > > > I'm implementing a dirty form checking component. > > > > > > > > > > Can I avoid the dreaded window.onbeforeunload and use some > > > > convenient > > > > > dojo-hook to upon unloading the form? > > > > > > > > > > Any ideas are welcome! > > > > > > > > > > thanks, Marcus > > > > > > > > > > > > > > > > > > > > > -- > > > > Jesse Kuhnert > > > > Tapestry/Dojo team member/developer > > > > > > > > Open source based consulting work centered around > > > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > Jesse Kuhnert > > Tapestry/Dojo team member/developer > > > > Open source based consulting work centered around > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / JEE Consulting
Re: dirty form checking ...
I think you can connect to tapestry.form.onFormSubmit as per: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form.js?view=markup On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Yes, that's what I started with. The basic check works, now. But I can't seem to hook into regular form-submission nicely, to switch off the dirty-check in that case. I tried dojo.event.connect(form_${formName},"onsubmit",tapestry.dirtyFormWarning , "defuse"); That works just fine for @Submit, but not at all for @LinkSubmit ... . > -Original Message- > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 09, 2007 3:53 PM > To: Tapestry users > Subject: Re: dirty form checking ... > > Oh ...Forgot that you wanted to stop it. Yeah that wouldn't > work there. > > I don't think there is anything to do other than what tacos does: > > http://opencomponentry.com:8080/tacos/forms/DirtyFormExample.html > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > thanks, but I don't seem to be able to veto that event. > > dojo.event.browser.stopEvent(evt) doesn't seem to work ... > > > > > -Original Message- > > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, May 09, 2007 2:57 PM > > > To: Tapestry users > > > Subject: Re: dirty form checking ... > > > > > > dojo.addOnUnload > > > > > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > > I'm implementing a dirty form checking component. > > > > > > > > Can I avoid the dreaded window.onbeforeunload and use some > > > convenient > > > > dojo-hook to upon unloading the form? > > > > > > > > Any ideas are welcome! > > > > > > > > thanks, Marcus > > > > > > > > > > > > > > > > -- > > > Jesse Kuhnert > > > Tapestry/Dojo team member/developer > > > > > > Open source based consulting work centered around > > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Jesse Kuhnert > Tapestry/Dojo team member/developer > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
RE: dirty form checking ...
Yes, that's what I started with. The basic check works, now. But I can't seem to hook into regular form-submission nicely, to switch off the dirty-check in that case. I tried dojo.event.connect(form_${formName},"onsubmit",tapestry.dirtyFormWarning , "defuse"); That works just fine for @Submit, but not at all for @LinkSubmit ... . > -Original Message- > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 09, 2007 3:53 PM > To: Tapestry users > Subject: Re: dirty form checking ... > > Oh ...Forgot that you wanted to stop it. Yeah that wouldn't > work there. > > I don't think there is anything to do other than what tacos does: > > http://opencomponentry.com:8080/tacos/forms/DirtyFormExample.html > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > thanks, but I don't seem to be able to veto that event. > > dojo.event.browser.stopEvent(evt) doesn't seem to work ... > > > > > -Original Message- > > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, May 09, 2007 2:57 PM > > > To: Tapestry users > > > Subject: Re: dirty form checking ... > > > > > > dojo.addOnUnload > > > > > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > > I'm implementing a dirty form checking component. > > > > > > > > Can I avoid the dreaded window.onbeforeunload and use some > > > convenient > > > > dojo-hook to upon unloading the form? > > > > > > > > Any ideas are welcome! > > > > > > > > thanks, Marcus > > > > > > > > > > > > > > > > -- > > > Jesse Kuhnert > > > Tapestry/Dojo team member/developer > > > > > > Open source based consulting work centered around > > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Jesse Kuhnert > Tapestry/Dojo team member/developer > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dirty form checking ...
Oh ...Forgot that you wanted to stop it. Yeah that wouldn't work there. I don't think there is anything to do other than what tacos does: http://opencomponentry.com:8080/tacos/forms/DirtyFormExample.html On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: thanks, but I don't seem to be able to veto that event. dojo.event.browser.stopEvent(evt) doesn't seem to work ... > -Original Message- > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 09, 2007 2:57 PM > To: Tapestry users > Subject: Re: dirty form checking ... > > dojo.addOnUnload > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I'm implementing a dirty form checking component. > > > > Can I avoid the dreaded window.onbeforeunload and use some > convenient > > dojo-hook to upon unloading the form? > > > > Any ideas are welcome! > > > > thanks, Marcus > > > > > > -- > Jesse Kuhnert > Tapestry/Dojo team member/developer > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
RE: dirty form checking ...
thanks, but I don't seem to be able to veto that event. dojo.event.browser.stopEvent(evt) doesn't seem to work ... > -Original Message- > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 09, 2007 2:57 PM > To: Tapestry users > Subject: Re: dirty form checking ... > > dojo.addOnUnload > > On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I'm implementing a dirty form checking component. > > > > Can I avoid the dreaded window.onbeforeunload and use some > convenient > > dojo-hook to upon unloading the form? > > > > Any ideas are welcome! > > > > thanks, Marcus > > > > > > -- > Jesse Kuhnert > Tapestry/Dojo team member/developer > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dirty form checking ...
dojo.addOnUnload On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I'm implementing a dirty form checking component. Can I avoid the dreaded window.onbeforeunload and use some convenient dojo-hook to upon unloading the form? Any ideas are welcome! thanks, Marcus -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
dirty form checking ...
I'm implementing a dirty form checking component. Can I avoid the dreaded window.onbeforeunload and use some convenient dojo-hook to upon unloading the form? Any ideas are welcome! thanks, Marcus