You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Theo vN <th...@gmail.com> on 2006/05/12 22:29:30 UTC

Validation BEFORE submit

Hi

Our project requires multiple stages of validation of data editable in a
form.

At first there is a draft stage - all submitted fields should be validated
but not all required fields have to be filled in - all submitted fields must
be persisted to database.

Second stage requires more in depth validation and even more so during third
stage. The required validation stage change does not coincide with form
submission but is process driven - the user is required to subsequently
update/adjust form data to comply to finer grain validations.

It seems not a problem to dynamically change validators and validation code
based on state.

What I would like to do is to after state changes from say stage 2 to 3 and
more validation errors would occur on submission of form is to start the
editing of data in a form with these validation errors/messages already
showing - in other words I want to call the validation framework of the
page/form before doing the submit but already on the initial rendering of
the page+form and have the validationdelegate do rendering of error messages
and fields in error.

Is this possible?

-- 
Cheers
Theo

RE: Validation BEFORE submit

Posted by Jimmi Dyson <ji...@lawton.co.uk>.
I have written an integration between tapestry and fvalidate - amazingly
called tapestryfvalidate. You can download the jar file at:

https://tapestryfvalidate.dev.java.net/servlets/ProjectDocumentList

It's not documented though...

There is documentation on fvalidate at:
http://www.phil-taylor.com/fvalidate/

fvalidate is a really good javascript validation library, providing
loads of flexible validators.

Jim

-----Original Message-----
From: ZedroS Schwart [mailto:zedros.schwartz@gmail.com] 
Sent: 16 May 2006 12:17
To: Tapestry users
Subject: Re: Validation BEFORE submit

> For instance, the page can
> easily provide it's own validation that is not easily doable with
normal
> validators (eg making sure 2 password fields are equal).

It looks like something many tapestry developpers could use... Is there
a
possibility of seeing the code/putting in the wiki ?

Thanks in advance
ZedroS

On 5/15/06, Dan Adams <da...@ifactory.com> wrote:
>
> We did something similar by wrapping @Form with a component that can
> provided multiple levels of validation. For instance, the page can
> easily provide it's own validation that is not easily doable with
normal
> validators (eg making sure 2 password fields are equal). This has
worked
> well for us as a flexible way of creating custom validation without
> having to create validators (since most of the custom validation is
only
> used in one page/component anyway).
>
> On Fri, 2006-05-12 at 22:29 +0200, Theo vN wrote:
> > Hi
> >
> > Our project requires multiple stages of validation of data editable
in a
> > form.
> >
> > At first there is a draft stage - all submitted fields should be
> validated
> > but not all required fields have to be filled in - all submitted
fields
> must
> > be persisted to database.
> >
> > Second stage requires more in depth validation and even more so
during
> third
> > stage. The required validation stage change does not coincide with
form
> > submission but is process driven - the user is required to
subsequently
> > update/adjust form data to comply to finer grain validations.
> >
> > It seems not a problem to dynamically change validators and
validation
> code
> > based on state.
> >
> > What I would like to do is to after state changes from say stage 2
to 3
> and
> > more validation errors would occur on submission of form is to start
the
> > editing of data in a form with these validation errors/messages
already
> > showing - in other words I want to call the validation framework of
the
> > page/form before doing the submit but already on the initial
rendering
> of
> > the page+form and have the validationdelegate do rendering of error
> messages
> > and fields in error.
> >
> > Is this possible?
> >
> --
> Dan Adams
> Software Engineer
> Interactive Factory
> 617.235.5857
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Validation BEFORE submit

Posted by ZedroS Schwart <ze...@gmail.com>.
> For instance, the page can
> easily provide it's own validation that is not easily doable with normal
> validators (eg making sure 2 password fields are equal).

It looks like something many tapestry developpers could use... Is there a
possibility of seeing the code/putting in the wiki ?

Thanks in advance
ZedroS

On 5/15/06, Dan Adams <da...@ifactory.com> wrote:
>
> We did something similar by wrapping @Form with a component that can
> provided multiple levels of validation. For instance, the page can
> easily provide it's own validation that is not easily doable with normal
> validators (eg making sure 2 password fields are equal). This has worked
> well for us as a flexible way of creating custom validation without
> having to create validators (since most of the custom validation is only
> used in one page/component anyway).
>
> On Fri, 2006-05-12 at 22:29 +0200, Theo vN wrote:
> > Hi
> >
> > Our project requires multiple stages of validation of data editable in a
> > form.
> >
> > At first there is a draft stage - all submitted fields should be
> validated
> > but not all required fields have to be filled in - all submitted fields
> must
> > be persisted to database.
> >
> > Second stage requires more in depth validation and even more so during
> third
> > stage. The required validation stage change does not coincide with form
> > submission but is process driven - the user is required to subsequently
> > update/adjust form data to comply to finer grain validations.
> >
> > It seems not a problem to dynamically change validators and validation
> code
> > based on state.
> >
> > What I would like to do is to after state changes from say stage 2 to 3
> and
> > more validation errors would occur on submission of form is to start the
> > editing of data in a form with these validation errors/messages already
> > showing - in other words I want to call the validation framework of the
> > page/form before doing the submit but already on the initial rendering
> of
> > the page+form and have the validationdelegate do rendering of error
> messages
> > and fields in error.
> >
> > Is this possible?
> >
> --
> Dan Adams
> Software Engineer
> Interactive Factory
> 617.235.5857
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Validation BEFORE submit

Posted by Dan Adams <da...@ifactory.com>.
We did something similar by wrapping @Form with a component that can
provided multiple levels of validation. For instance, the page can
easily provide it's own validation that is not easily doable with normal
validators (eg making sure 2 password fields are equal). This has worked
well for us as a flexible way of creating custom validation without
having to create validators (since most of the custom validation is only
used in one page/component anyway).

On Fri, 2006-05-12 at 22:29 +0200, Theo vN wrote:
> Hi
> 
> Our project requires multiple stages of validation of data editable in a
> form.
> 
> At first there is a draft stage - all submitted fields should be validated
> but not all required fields have to be filled in - all submitted fields must
> be persisted to database.
> 
> Second stage requires more in depth validation and even more so during third
> stage. The required validation stage change does not coincide with form
> submission but is process driven - the user is required to subsequently
> update/adjust form data to comply to finer grain validations.
> 
> It seems not a problem to dynamically change validators and validation code
> based on state.
> 
> What I would like to do is to after state changes from say stage 2 to 3 and
> more validation errors would occur on submission of form is to start the
> editing of data in a form with these validation errors/messages already
> showing - in other words I want to call the validation framework of the
> page/form before doing the submit but already on the initial rendering of
> the page+form and have the validationdelegate do rendering of error messages
> and fields in error.
> 
> Is this possible?
> 
-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org