You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bas Passon <b....@first8.nl> on 2002/10/30 14:43:04 UTC

Validation of a field that is optional.

Hi,

I'm using the validator for validation of my forms. In specifying the
forms I came across the following problem for which I haven't found a
solution anywhere yet.

First I had a problem with validation of optional fields, this was solved
through removing the depends='required' from the validation-rules.xml.
This however resulted in a new problem I now need a solution for.

Problem description:

For the ease of reading I used the date validation, you could replace that
with any other type.

I noticed the date validation works acording the following rule: 'If I
have a value for a field defined as type 'date' it has to be of the format
specified. This is the correct specification of the date validation
routine for fields of type 'date' that are required, but it is not
correctly specified when the type 'date' does not depend on 'required'.

When using optional fields the specification for type 'date' should be:
'If I have a value for a field defined as type 'date' and the value of
this field has a length greater than zero it has to be of the format
specified.

In the current implementation of the validator library the following
depends sets are identical:

  <field property="a" depends="required,date">

and

  <field property="a" depends="date">

This should not be the case if optional field validation for type 'date'
is to work properly.

Is there anyone who has noticed the same and found a solution for this
problem other than writing a complete custom set op validation methods?

Thanks in advance,

Bas Passon

-----------------------
Bas Passon
First8 - http://www.first8.nl
Email: b.passon@first8.nl
Phone: +31 (0)24 348 38 77
Fax:   +31 (0)24 348 35 71


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


HTMLTable framework for Struts

Posted by Rainer Mueller <rm...@inventage.com>.
Hi,

has anyone used the HTMLTable framework from Yuriy Zubarev? Are there any
alternatives for handling table sorting/paging within Struts?


Thanks,
Rainer

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>