Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

Provide access to FailedValidations messages from Validations component

Open mtbayley opened this issue 11 months ago • 4 comments

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 avatar Jan 29 '25 16:01 mtbayley

I can contribute. LMK if this sounds ok

mtbayley avatar Jan 29 '25 16:01 mtbayley

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.

stsrki avatar Jan 29 '25 16:01 stsrki

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 avatar Jan 29 '25 16:01 mtbayley

What about having ValidateAll return the messages?

mtbayley avatar Jan 29 '25 16:01 mtbayley