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

Provide access to FailedValidations messages from Validations component #5956

Open
mtbayley opened this issue Jan 29, 2025 · 4 comments
Open
Labels
Type: Feature ⚙ Request or idea for a new feature.

Comments

@mtbayley
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I would like to be able to access to validation messages from the Validations object so I can show in a message, notification or toast instead of a ValidationsSummary

Describe the solution you'd like
In Validations.razor.cs, make FailedValidations property public

@mtbayley mtbayley added the Type: Feature ⚙ Request or idea for a new feature. label Jan 29, 2025
@mtbayley
Copy link
Contributor Author

I can contribute. LMK if this sounds ok

@stsrki
Copy link
Collaborator

stsrki commented Jan 29, 2025

Making it public is easy. But I would like to find better alternative if possible.

Also, have you tried the StatusChanged callback? It should be raised with FailedValidations as an attribute.

@mtbayley
Copy link
Contributor Author

Yes I guess I could access the messages with the StatusChanged event, but that would require an additional backing property on every page I use validations.

I may be missing something, but what are your concerns with making the readonly collection public?

@mtbayley
Copy link
Contributor Author

What about having ValidateAll return the messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature ⚙ Request or idea for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants