RE: Validation Error Messages

Very nice. I really like the catch-all touch. However, there are two things
that I should point out that may or may not matter.

1.) This introduces another level of modularity by separating validation
messages from both the model and the individual ui control elements. It kind
of sits in the middle, which makes sense conceptually but may introduce
unwanted complexity.

2.) By using the type names as the names of elements it makes it hard to
attach strict Schema info to the messages element and children. Moving the
type names to use an attribute might be a good idea. Also you could make the
attribute a QName list type allowing the message to apply to multiple types.
e.g.

<messages locale='EN'>
	<message types='startDate'>
		<facet type='required'>startDate is required.</facet>
		<facet type='max'>...</facet>
	</message>
	<message types='startDate endDate'>
		<facet type='pattern'>bla bla</facet>
	</message>
</messages>

This mods your facet failed search to something like:

messages[@locale=getlocale()]/message[contains(@types,p)]/facet[@type=f]

- Ryan

> -----Original Message-----
> From: Niall Smart [mailto:regkey@yahoo.com]
> Sent: Tuesday, July 03, 2001 9:14 AM
> To: ryant@mad.scientist.com; www-forms@w3.org
> Subject: 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 Wednesday, 4 July 2001 02:53:37 UTC