wiln / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

Form and form items do not properly validate upon reset #190

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a reset Button.
2. Call resetForm() from the Button.

What is the expected output? What do you see instead?

Actual:
1. The data model changes upon reset.

2. All the form item validators are disabled.

3. All the form items have their isValid property set to an invalid state.

4. The form's isValid property is set based upon the aggregate (incorrect)
validity of the form items.

5. The user is forced to trigger the validation of all the form items (even
the ones that should be valid) to correct the form's isValid property.

Expected:
1. The data model changes upon reset.

2. The individual form items should be validated.

3. The form's isValid property is set based upon the aggregate validity of
the form items.

Backing principle:
Prevent, Don't Scold
The user should not be allowed to submit a form that has validation errors.

4. The individual form items should have their errorStrings set to null
even if the form item is invalid.

Backing principle:
Innocent Until Proven Guilty

The user should be warned about a validation error on a control only if
they have had a chance to interact with that control. (In other words, you
should not perform validation on controls that are in their initial state
and initially display a form full of validation errors.) Similarly,
resetting a form should remove all validation errors.

What version of the product are you using? On what operating system?

http://flexlib.googlecode.com/files/flexlib-.2.4.zip. Windows Vista 64 bit.

Please provide any additional information below.
I have attached a patch for this issue.

Original issue reported on code.google.com by dtba...@gmail.com on 25 Jan 2009 at 6:54

Attachments: