Validation Error Messages

All:

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.

For instance, if I have a textbox that's bound to a model item with date
type restraints and the user enters a decimal, how does the processor know
to tell the user, "PO Date must be a date with format: MM/DD/YYYY"? This
message can broken down into two primary parts: First, the validation
message, which specifies the invalid aspects of the data (e.g. "must be a
date with format: MM/DD/YYYY"). Second, the individual form control that
generated the invalid data (e.g. "PO Date").

Seperating these allows the same validation message to be attached to many
ui controls, which is the general data model idea. Thus, it seems reasonable
to extend the data model syntax to accept a "message" attribute. So, to
illustrate how the above example might look, consider:

<xform...>
	<instance>
		<po><info><date>10/10/2001</date></info></po>
	</instance>
	<model>
		...
		<xsd:simpleType
			name='date' ...
			xf:message='%c must be a date with format MM/DD/YYYY'/>
		...
	</model>
</xform>

<textbox ref='po/info/date'>
	<caption>PO Date</caption>
</textbox>

The textbox is bound to the instance value at XPath "po/info/date", and the
instance value is somehow associated with the (really bad example of a)
simpleType within the model. When the processor comes across this textbox
and finds that the value entered does not meet the validation requirements,
it will display the appropriate message and interpolate the %c with the the
<caption> of the control.

Obviously the idea's contained in this email need some work but it seems
that excluding this as a functional would make giving the user a helpful
error message very hard for the processor as it would have to resort to some
form of deduction to build an error message which would probably be very
user-unfriendly (i.e. "PO Date must match regular expression pattern:
'\d\d\/\d\d/\d\d\d\d'").

Thanks,

Ryan Tomayko <mailto:rtomayko@stercomm.com>
Sterling Commerce
www.sterlingcommerce.com

Received on Tuesday, 3 July 2001 08:41:03 UTC