Re: Validation Error Messages

--- Ryan Tomayko <rtomayko@columbus.rr.com> wrote:

> I would like to suggest facilities for attaching a caption or descriptive
> message to data model validation or individual ui controls. In essence, the
> message would describe the validation error that occured. This is necessary
> if a descriptive message is to be given to the user when a field fails
> validation.

I had also been thinking about this, but came up with a different model to
the one you are proposing.  My approach allows different messages to be
displayed depending on which facet has not been complied with.  For example,
given this model:

<model>
    <date name="startDate" required="true" max="endDate">
    <date name="endDate" required="true" min="startDate">
</model>

then the error messages would be associated with the model using the
following syntax:

<messages locale="EN">
    <startDate>
        <required>You must enter a start date.</required>
        <max>The start date must be before the end date.</max>
    </startDate>
    <endDate>
        <required>You must enter an end date.</required>
        <min>The end date must be after the start date.</max>
    </endDate>

    <required>You have not entered a mandatory field.</required>
</messages>

In the event of a facet f on model item with path p not being complied
with then the processor will search for

    messages[@locale=getlocale()]/p/f

If this is not found then the last path element of p will be stripped
off and it will try again, this allows "catch-all" error messages to
be specified as above.

Comments?

Niall


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Received on Tuesday, 3 July 2001 09:14:15 UTC