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 mcteague <jo...@gmail.com> on 2005/06/25 14:10:19 UTC

Form validation issue

I have the following form validation scenario that is causing some problems:

On my page I have two sets of three ValidFields, plus a Link Submit
component for each set:


[ValidField1-1][ValidField1-2][ValidField[1-3]
                                         [LinkSubmit1]

[ValidField2-1][ValidField2-2][ValidField[2-3]
                                         [LinkSubmit2]

ValidFields 1-1,1-2 and 1.3 are mandatory if LinkSubmit1 is clicked.
Likewise, fields 2-1,2-2 and 2-3 are mandatory if LinkSubmit2 is clicked.

I have 2 property-specifications of type boolean, each linked to the
LinkSubmits using the selected/tag bindings, so that in my Java class
for the page, I can perform some extra work depending on what link was
clicked.

If I click on the First LinkSubmit, the property-specification is
updated, however, not until AFTER the three valid fields have been
validated, so I cannot create a validator whose required property is
bound to the property-specification.

Is there a way around this, or a better way of selectively validating
the fields (without resorting to extra code in the Java class).

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


Re: Form validation issue

Posted by Pablo Ruggia <pr...@gmail.com>.
I've done that, but i've subclassed ValidationDelegate and override record 
methods, so when some validator records an error, I can select to record it 
or discard it.
I've to tell you that is not that easy.

On 6/25/05, john mcteague <jo...@gmail.com> wrote:
> 
> I have the following form validation scenario that is causing some 
> problems:
> 
> On my page I have two sets of three ValidFields, plus a Link Submit
> component for each set:
> 
> 
> [ValidField1-1][ValidField1-2][ValidField[1-3]
> [LinkSubmit1]
> 
> [ValidField2-1][ValidField2-2][ValidField[2-3]
> [LinkSubmit2]
> 
> ValidFields 1-1,1-2 and 1.3 are mandatory if LinkSubmit1 is clicked.
> Likewise, fields 2-1,2-2 and 2-3 are mandatory if LinkSubmit2 is clicked.
> 
> I have 2 property-specifications of type boolean, each linked to the
> LinkSubmits using the selected/tag bindings, so that in my Java class
> for the page, I can perform some extra work depending on what link was
> clicked.
> 
> If I click on the First LinkSubmit, the property-specification is
> updated, however, not until AFTER the three valid fields have been
> validated, so I cannot create a validator whose required property is
> bound to the property-specification.
> 
> Is there a way around this, or a better way of selectively validating
> the fields (without resorting to extra code in the Java class).
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>