ValidationMessage for collection
See original GitHub issuei validate a collection of strings to match some regex, and i want to show the error messages connected to the collection with the <ValidationMessage />
component. The errors are connected with property with index InputTagNames[0]
but i can not get <ValidationMessage />
to map into that.
in the below image, the two rules that are highlighted are the implementation i wished to use but that i can not use. and below is my workaround with custom validation.
The custom validation workaround loops the collection and add a ValidationFailure
to the context, where i am able to set the property name to be the name of the collection, so when i display <ValidationMessage For="@(() => Model.InputTagNames)" />
it shows up correctly
Is there a better way i can map the collection to the ´<ValidationMessage />´?
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
I found out i had other problems that might interfear. I validated manuel on an other instave of the object then the one connected to the editContext. Atm. Im going with my workaround
@tgaarde Did you resolve the issue ?