-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
priority:mediumFix when possibleFix when possibletype:featureNew feature or enhancement requestNew feature or enhancement request
Description
Summary
EditContext's flat model design means nested field identifiers (e.g., Items[0].ProductName) are currently handled at the component level rather than through Blazor's built-in FieldIdentifier system. The current approach works but could be improved for better integration with Blazor's validation infrastructure.
Context
Introduced in #20 (one-to-many collection field support). The CollectionFieldComponent manages its own validation state per item rather than leveraging EditContext.NotifyFieldChanged with proper nested field identifiers. This means:
- Validation messages are rendered by the component itself, not by Blazor's
ValidationMessage<T> EditContext.IsModified()doesn't reflect changes in collection item fields- Third-party validation summary components won't pick up nested field errors
Suggested Approach
- Implement a custom
FieldIdentifierstrategy that encodes collection index and property path (e.g.,Items[0].ProductName) - Propagate field change notifications to the parent
EditContext - Enable
ValidationMessageandValidationSummaryto display nested errors natively
Acceptance Criteria
- Collection item field changes notify the parent
EditContext -
EditContext.IsModified("Items[0].ProductName")returns correct state - Blazor's
ValidationSummarydisplays nested field errors - No regression in existing collection field functionality
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:mediumFix when possibleFix when possibletype:featureNew feature or enhancement requestNew feature or enhancement request