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

Field validator is invoked 5 times on each value change #2821

Closed
gorbunkov opened this issue Feb 1, 2024 · 1 comment · Fixed by #2855
Closed

Field validator is invoked 5 times on each value change #2821

gorbunkov opened this issue Feb 1, 2024 · 1 comment · Fixed by #2855
Assignees
Labels
breaking changes Fix brings breaking changes in code or behavior in: flowui size: S type: bug Something isn't working
Milestone

Comments

@gorbunkov
Copy link
Contributor

Environment

Jmix version: 2.1.3

Bug Description

Field validator is invoked 5 times

Steps To Reproduce

Using the Studio add the validator to the TextField component, e.g.:

    @Install(to = "firstNameField", subject = "validator")
    private void firstNameFieldValidator(final String value) {
        log.info("First name validated: {}", value);
    }

Type some text into the field and click into another text field.

Current Behavior

Validator is invoked 5 times and there is the following in the application log:

2024-02-01T13:37:02.702+04:00  INFO 50820 --- [nio-8080-exec-3] c.c.f.view.customer.CustomerDetailView   : First name validated: John1
2024-02-01T13:37:12.502+04:00  INFO 50820 --- [nio-8080-exec-3] c.c.f.view.customer.CustomerDetailView   : First name validated: John1
2024-02-01T13:37:19.703+04:00  INFO 50820 --- [nio-8080-exec-3] c.c.f.view.customer.CustomerDetailView   : First name validated: John1
2024-02-01T13:37:22.447+04:00  INFO 50820 --- [nio-8080-exec-3] c.c.f.view.customer.CustomerDetailView   : First name validated: John1
2024-02-01T13:37:24.526+04:00  INFO 50820 --- [nio-8080-exec-3] c.c.f.view.customer.CustomerDetailView   : First name validated: John1

Expected Behavior

Validator is invoked once.

Sample Project

See CustomerDetailView

field-validator.zip

@gorbunkov gorbunkov added type: bug Something isn't working in: flowui triage Issue is waiting for triage size: S and removed triage Issue is waiting for triage labels Feb 1, 2024
@gorbunkov gorbunkov changed the title Field validator is invoked 5 times on each value chane Field validator is invoked 5 times on each value chanпe Feb 2, 2024
@gorbunkov gorbunkov changed the title Field validator is invoked 5 times on each value chanпe Field validator is invoked 5 times on each value change Feb 6, 2024
@Flaurite Flaurite added the breaking changes Fix brings breaking changes in code or behavior label Feb 12, 2024
@Flaurite
Copy link
Contributor

Flaurite commented Feb 13, 2024

Breaking Changes

Affected FileUploadFIeld and FileStorageUploadField. Now isInvalid() method does not trigger validation. It only checks invalid state of the field.

QA

  1. Check that error state is changed correctly and check validation, required for the following fields:
  • JmixCheckboxGroup
  • JmixMultiSelectComboBox
  • JmixMultiSelectComboBoxPicker
  • TypedTextField
  • FileStorageUploadField
  • FileUploadField
  1. Also, please check this case: The validation message does not disappear after the correct data is entered #1456

@Flaurite Flaurite reopened this Feb 15, 2024
@rusiaikinat rusiaikinat self-assigned this Feb 15, 2024
@gorbunkov gorbunkov added this to the 2.2.0 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes Fix brings breaking changes in code or behavior in: flowui size: S type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants