I have encountered an issue with the way field validation errors are
displayed. Using the ContactMgr application that is distributed with
the JMatter source: When I enter an invalid value (aaa instead of
a...@bbb.com) in the email field of a new 'business' object and then
leave the field via hitting <tab>, it correctly displays an error
("Invalid email address syntax: aaa "). However, if I then type
another character in the field and hit tab to leave the field, the
validation error disappears even though the value is still invalid.
The field validation error is not displayed until I hit <return>
(validated on save?).
It seems like validation errors only get displayed if the previous
value was empty or valid. If I enter a well-formed value for the
email field, hit <tab> and successfully move to the next field, I can
then go back, enter a bad value and get the error message. But after
that, it's the same behavior I originally described. Validation errors
aren't displayed when leaving the field if the value was invalid
before the edits were made.
This seems to only happen with Complex data types. For an Int value,
if I enter an illegal value (such as an alpha character), it will
repeatedly display the validation error.
Ultimately, the incorrectly entered values will get caught by the
validation on 'Save', but this is less than ideal for a user that has
entered numerous incorrect values.
Any suggestions on how to work around this?