Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: validateUntilFirstError(), because validate() always validates all fields [moved] #42

Open
jonnybbb opened this issue Nov 18, 2012 · 0 comments

Comments

@jonnybbb
Copy link
Contributor

This is Issue 42 moved from a Google Code project.
Added by 2011-04-18T07:42:50.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

<b>What steps will reproduce the problem?</b>
1. if you defined a form validation the validate() function will always validate all fields
2. if you change the class=&quot;&quot; of the fields that are invalid then all invalid fields classes are changed at once 

<b>What is the expected output? What do you see instead?</b>
a new function &quot;validateUntilFirstError&quot; in com.pietschy.gwt.pectin.client.form.validation/FormValidator.java that validates the fields in the right order and stops at the first error

<b>What version of the product are you using? On what operating system?</b>
0.8

<b>Please provide any additional information below.</b>
can be solved by adding a sorted list of validators:
private ArrayList<HasValidation> sortedFieldValidators = new ArrayList<HasValidation>();
Instead o iterate over all validators in no specific order like in validate:
for (HasValidation validator : fieldValidators.values())
you could iterate over the sorted validators and stop when error occurs:
for (HasValidation validator : sortedFieldValidators)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant