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

Validation fixes #18535

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Validation fixes #18535

merged 5 commits into from
Jan 26, 2024

Conversation

tepi
Copy link
Contributor

@tepi tepi commented Jan 25, 2024

Changes:

  1. Once Binder.handleFieldValueChange runs for a binding when readBean was used, the whole binder will be silently validated also. BinderValidationStatusHandler is called like before (only contains status from changed binding), but StatusChangeEvent is now fired considering all bindings and if possible bean validators as well.
  2. Once Binder.handleFieldValueChange runs for a binding when setBean was used, doWriteIfValid will validate all bindings, not only the changed ones. This prevents writing an invalid bean in cases where one or more of the initial values are in invalid state (but not marked as such since setBean resets validation status), but they have not been changed from their initial value(s).
  3. Calling setAsRequiredEnabled with a changed value no longer triggers validation, since that validation is now handled elsewhere when needed as stated above.
  4. Minor Javadoc fixes, trying to align Javadocs with code.

Fixes #18163
Fixes #4988
Fixes #17515

Probably fixes some other binder / validation issues as well.

Copy link

github-actions bot commented Jan 25, 2024

Test Results

1 092 files  ± 0  1 092 suites  ±0   1h 23m 41s ⏱️ + 3m 31s
6 810 tests + 2  6 764 ✅ + 2  46 💤 ±0  0 ❌ ±0 
7 168 runs  +15  7 110 ✅ +15  58 💤 ±0  0 ❌ ±0 

Results for commit 7cd1ae2. ± Comparison against base commit 19f1337.

♻️ This comment has been updated with latest results.

Copy link

sonarcloud bot commented Jan 26, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mcollovati mcollovati merged commit 1d3b60c into main Jan 26, 2024
25 of 26 checks passed
@mcollovati mcollovati deleted the validation-changes branch January 26, 2024 11:39
vaadin-bot pushed a commit that referenced this pull request Jan 26, 2024
Changes:

- Once Binder.handleFieldValueChange runs for a binding when readBean was used, the whole binder will be silently validated also. BinderValidationStatusHandler is called like before (only contains status from changed binding), but StatusChangeEvent is now fired considering all bindings and if possible bean validators as well.
- Once Binder.handleFieldValueChange runs for a binding when setBean was used, doWriteIfValid will validate all bindings, not only the changed ones. This prevents writing an invalid bean in cases where one or more of the initial values are in invalid state (but not marked as such since setBean resets validation status), but they have not been changed from their initial value(s).
 Calling setAsRequiredEnabled with a changed value no longer triggers validation, since that validation is now handled elsewhere when needed as stated above.

Minor Javadoc fixes, trying to align Javadocs with code.

Fixes #18163
Fixes #4988
Fixes #17515
vaadin-bot pushed a commit that referenced this pull request Jan 26, 2024
Changes:

- Once Binder.handleFieldValueChange runs for a binding when readBean was used, the whole binder will be silently validated also. BinderValidationStatusHandler is called like before (only contains status from changed binding), but StatusChangeEvent is now fired considering all bindings and if possible bean validators as well.
- Once Binder.handleFieldValueChange runs for a binding when setBean was used, doWriteIfValid will validate all bindings, not only the changed ones. This prevents writing an invalid bean in cases where one or more of the initial values are in invalid state (but not marked as such since setBean resets validation status), but they have not been changed from their initial value(s).
 Calling setAsRequiredEnabled with a changed value no longer triggers validation, since that validation is now handled elsewhere when needed as stated above.

Minor Javadoc fixes, trying to align Javadocs with code.

Fixes #18163
Fixes #4988
Fixes #17515
vaadin-bot added a commit that referenced this pull request Jan 26, 2024
Changes:

- Once Binder.handleFieldValueChange runs for a binding when readBean was used, the whole binder will be silently validated also. BinderValidationStatusHandler is called like before (only contains status from changed binding), but StatusChangeEvent is now fired considering all bindings and if possible bean validators as well.
- Once Binder.handleFieldValueChange runs for a binding when setBean was used, doWriteIfValid will validate all bindings, not only the changed ones. This prevents writing an invalid bean in cases where one or more of the initial values are in invalid state (but not marked as such since setBean resets validation status), but they have not been changed from their initial value(s).
 Calling setAsRequiredEnabled with a changed value no longer triggers validation, since that validation is now handled elsewhere when needed as stated above.

Minor Javadoc fixes, trying to align Javadocs with code.

Fixes #18163
Fixes #4988
Fixes #17515

Co-authored-by: Teppo Kurki <[email protected]>
vaadin-bot added a commit that referenced this pull request Jan 26, 2024
Changes:

- Once Binder.handleFieldValueChange runs for a binding when readBean was used, the whole binder will be silently validated also. BinderValidationStatusHandler is called like before (only contains status from changed binding), but StatusChangeEvent is now fired considering all bindings and if possible bean validators as well.
- Once Binder.handleFieldValueChange runs for a binding when setBean was used, doWriteIfValid will validate all bindings, not only the changed ones. This prevents writing an invalid bean in cases where one or more of the initial values are in invalid state (but not marked as such since setBean resets validation status), but they have not been changed from their initial value(s).
 Calling setAsRequiredEnabled with a changed value no longer triggers validation, since that validation is now handled elsewhere when needed as stated above.

Minor Javadoc fixes, trying to align Javadocs with code.

Fixes #18163
Fixes #4988
Fixes #17515

Co-authored-by: Teppo Kurki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment