You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John Meredith <ps...@t-online.de> on 2003/07/08 17:58:37 UTC

Form validation

Hi,

On validating form input, does Tapestry check/record all fields
associated with a validator or does it stop at the first one?

The reason I ask is that I'd like to have some way to display the error
message for all fields instead of just the first.

Is this possible?

TIA,

  John

-- 
John Meredith <ps...@t-online.de>


Re: Form validation

Posted by Harish Krishnaswamy <hk...@comcast.net>.
That is the default behavior of the ValidField component. When there is 
a validation exception, it logs the error in the delegate and simply 
returns (does not throw an exception). So all messages are collected in 
the delegate at the end the cycle.

-Harish

John Meredith wrote:

>Hi,
>
>On validating form input, does Tapestry check/record all fields
>associated with a validator or does it stop at the first one?
>
>The reason I ask is that I'd like to have some way to display the error
>message for all fields instead of just the first.
>
>Is this possible?
>
>TIA,
>
>  John
>
>  
>



RE: Form validation

Posted by John Meredith <ps...@t-online.de>.
Thanks. Got it working for each field as suggested.

Another quick question if I may: Is it possible to discover if a
ValidField component isRequired() from writeLabelPrefix()?

  John

On Tue, 2003-07-08 at 19:37, Howard M. Lewis Ship wrote:
> The examples explicitly display just the first error, but the validation delegate tracks all errors.
> My bias is to display just the first error, but mark all fields in error.
> 
> With minimal effort, you could put the error for each field next to the field as well.  The
> validation delegate has all the rendering hooks needed to accomplish this.
> 
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> 
> 
> 
> > -----Original Message-----
> > From: John Meredith [mailto:psynix@t-online.de] 
> > Sent: Tuesday, July 08, 2003 11:59 AM
> > To: Tapestry users
> > Subject: Form validation
> > 
> > 
> > Hi,
> > 
> > On validating form input, does Tapestry check/record all 
> > fields associated with a validator or does it stop at the first one?
> > 
> > The reason I ask is that I'd like to have some way to display 
> > the error message for all fields instead of just the first.
> > 
> > Is this possible?
> > 
> > TIA,
> > 
> >   John
> > 
> > -- 
> > John Meredith <ps...@t-online.de>
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
-- 
John Meredith <ps...@t-online.de>


RE: Form validation

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
The examples explicitly display just the first error, but the validation delegate tracks all errors.
My bias is to display just the first error, but mark all fields in error.

With minimal effort, you could put the error for each field next to the field as well.  The
validation delegate has all the rendering hooks needed to accomplish this.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: John Meredith [mailto:psynix@t-online.de] 
> Sent: Tuesday, July 08, 2003 11:59 AM
> To: Tapestry users
> Subject: Form validation
> 
> 
> Hi,
> 
> On validating form input, does Tapestry check/record all 
> fields associated with a validator or does it stop at the first one?
> 
> The reason I ask is that I'd like to have some way to display 
> the error message for all fields instead of just the first.
> 
> Is this possible?
> 
> TIA,
> 
>   John
> 
> -- 
> John Meredith <ps...@t-online.de>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>