Add and document the pattern for forms and validation in components with collections of items #8189
Labels
area-blazor
Includes: Blazor, Razor Components
bug
This issue describes a behavior which is not expected - a bug.
Needs: Design
This issue requires design work before implementating.
Milestone
Consider a model like:
How we would write a form that lets you add a dynamic number of emergency contacts? I tried this during some app building time, and there are some problems with it that we could make better.
Issue 1
Doing the most obvious thing with a collection throws an IndexOutOfRangeException.
This works fine if you do it like this:
Issue 2
Validation doesn't automatically traverse the members of something so you have to manually add validation support for any sattelite objects you want validated.
Example: https://github.com/rynowak/ComponentFunTime/blob/master/Components/Shared/EmployeeEditor.razor#L85
The text was updated successfully, but these errors were encountered: