Re: dynamic forms concept & possible solutions
OK, so we can omit validation when needed. That's great (I wasn't aware of such a method), but I don't like "hidden submit" concept either, it looks more like a workaround rather than a solution. I remember from my earlier experience with Tapestry that simply calling form.submit() without any hidden submit button didn't work. Is that still the case? On Tue, Apr 15, 2014 at 12:26 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 14 Apr 2014 09:39:33 -0300, Chris Poulsen > wrote: > > I dont think onSuccess is called if validation fails, perhaps one could >> adjust the outcome of the validation phase of the form like suggested. >> > > Yeah, I just noticed that after I posted the message, and you're right > about the validation phase (specifically of the form) being the right place > for putting that code. Thanks for pointing this! :) > > > >> >> On Mon, Apr 14, 2014 at 2:19 PM, Thiago H de Paula Figueiredo < >> thiag...@gmail.com> wrote: >> >> On Mon, 14 Apr 2014 07:36:27 -0300, Ilya Obshadko < >>> ilya.obsha...@gmail.com> >>> wrote: >>> >>> - if we trigger form submission (it's possible to do that using hidden >>> submit, it's not very elegant, but it works), we have to go through form validation which fails in most cases because at this point form is not yet completed; user receives non-relevant validation errors >>> Please try this: >>> >>> @Environmental >>> private ValidationTracker validationTracker; >>> >>> public void onSuccess() { >>> if (notReallyValidationNow) { // submission from autocomplete >>> validationTracker.clear(); // all validation errors are >>> dropped >>> } >>> } >>> >>> -- >>> Thiago H. de Paula Figueiredo >>> Tapestry, Java and Hibernate consultant and developer >>> http://machina.com.br >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Ilya Obshadko
Re: dynamic forms concept & possible solutions
On Mon, 14 Apr 2014 09:39:33 -0300, Chris Poulsen wrote: I dont think onSuccess is called if validation fails, perhaps one could adjust the outcome of the validation phase of the form like suggested. Yeah, I just noticed that after I posted the message, and you're right about the validation phase (specifically of the form) being the right place for putting that code. Thanks for pointing this! :) On Mon, Apr 14, 2014 at 2:19 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: On Mon, 14 Apr 2014 07:36:27 -0300, Ilya Obshadko wrote: - if we trigger form submission (it's possible to do that using hidden submit, it's not very elegant, but it works), we have to go through form validation which fails in most cases because at this point form is not yet completed; user receives non-relevant validation errors Please try this: @Environmental private ValidationTracker validationTracker; public void onSuccess() { if (notReallyValidationNow) { // submission from autocomplete validationTracker.clear(); // all validation errors are dropped } } -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: dynamic forms concept & possible solutions
I think Thiago means onSubmit() (If there are errors, it will never reach on success, right?) This also means that client side validation must be disabled, or then a bit of JS must be used to disable it for the hidden button. (Js interface also exists to submit the form iirc, but for these bits someone else knows better than me probably.) Ville 14.4.2014 15:19, Thiago H de Paula Figueiredo kirjoitti: On Mon, 14 Apr 2014 07:36:27 -0300, Ilya Obshadko wrote: - if we trigger form submission (it's possible to do that using hidden submit, it's not very elegant, but it works), we have to go through form validation which fails in most cases because at this point form is not yet completed; user receives non-relevant validation errors Please try this: @Environmental private ValidationTracker validationTracker; public void onSuccess() { if (notReallyValidationNow) { // submission from autocomplete validationTracker.clear(); // all validation errors are dropped } } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: dynamic forms concept & possible solutions
I dont think onSuccess is called if validation fails, perhaps one could adjust the outcome of the validation phase of the form like suggested. On Mon, Apr 14, 2014 at 2:19 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 14 Apr 2014 07:36:27 -0300, Ilya Obshadko > wrote: > > - if we trigger form submission (it's possible to do that using hidden >> submit, it's not very elegant, but it works), we have to go through form >> validation which fails in most cases because at this point form is not >> yet completed; user receives non-relevant validation errors >> > > Please try this: > > @Environmental > private ValidationTracker validationTracker; > > public void onSuccess() { > if (notReallyValidationNow) { // submission from autocomplete > validationTracker.clear(); // all validation errors are > dropped > } > } > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: dynamic forms concept & possible solutions
On Mon, 14 Apr 2014 07:36:27 -0300, Ilya Obshadko wrote: - if we trigger form submission (it's possible to do that using hidden submit, it's not very elegant, but it works), we have to go through form validation which fails in most cases because at this point form is not yet completed; user receives non-relevant validation errors Please try this: @Environmental private ValidationTracker validationTracker; public void onSuccess() { if (notReallyValidationNow) { // submission from autocomplete validationTracker.clear(); // all validation errors are dropped } } -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org