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

Required validation of SELECTION and MULTIPLE_SELECTION fails #2

Closed
danpalmer101 opened this issue Nov 24, 2017 · 1 comment
Closed

Comments

@danpalmer101
Copy link

If you set a FormElement of type SELECTION or MULTIPLE_SELECTION as required, it will always fail validation because FormBuilder.validate() checks the value field on the FormElement but not the optionsSelected field that is set for these types.

if (element.getRequired()) {
    // Should check optionsSelected if element.type == SELECTION or MULTIPLE_SELECTION
    if (element.getValue() == null || element.getValue().length() == 0) {
        isValid = false;
        if (view instanceof EditText) {
            ((EditText) view).setError(element.getErrorMessageOrDefault());
        }
    }
}
@dariopellegrini
Copy link
Owner

Should be solved, but still the EditText error is not visible. Working on that.

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

2 participants