Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement FluentValidation in a form with multiple input controls. #1070

Open
aabordalo opened this issue Nov 29, 2024 · 2 comments
Open

Implement FluentValidation in a form with multiple input controls. #1070

aabordalo opened this issue Nov 29, 2024 · 2 comments

Comments

@aabordalo
Copy link

aabordalo commented Nov 29, 2024

Validation error messages are not positioned next to the corresponding input controls. Instead, they appear in a different location, making it difficult for users to identify which input control has the error.

image

@Hadi69ans
Copy link

There is no one to guide this problem?

@tomaforn
Copy link

tomaforn commented Jan 21, 2025

A couple of things needed for this, from the top of my head:

  1. Make sure the Endpoint produces a HttpValidationProblemDetails response for validation errors, and regenerate the apiclient.
  2. Extend the ApiHelper to handle such errors with code similar to this:
catch (ApiException<HttpValidationProblemDetails> ex)
{
    if (ex.Result.Errors is not null)
    {
        customValidation?.DisplayErrors(ex.Result.Errors);
    }
    else
    {
        snackbar.Add("Something went wrong!", Severity.Error);
    }
}

I think something similar already exists in V1, you could have a look there for other ideas.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants