LgEditForm
Module : Lagoon.UI
Namespace : Lagoon.UI.Components
Category: Forms
Inherits from: LgComponentBase
Based on branch release/5.0 --> https://github.com/dotnet/aspnetcore/blob/release/5.0/src/Components/Web/src/Forms/EditForm.cs Renders a form element that cascades an EditContext to descendants. Lagoon modifications: - Add DataAnnotationValidator and LgValidatorSummary in the BuildRenderTree - DRAFT Add OnEditStateChanged event
Parameters
| Parameter | Type | Description |
|---|---|---|
AdditionalAttributes | IReadOnlyDictionary<string, object> | Gets or sets a collection of additional attributes that will be applied to the created form element. |
ChildContent | RenderFragment<EditContext> | Specifies the content to be rendered inside this EditForm. |
ConfirmationMessage | string | Gets or sets the confirmation message to show before submit. |
CssClass | string | Gets or sets the CSS classes. |
EditContext | EditContext | Supplies the edit context explicitly. If using this parameter, do not also supply Model, since the model value will be taken from the EditContext.Model property. |
ErrorsDisplayOptions | EditFormErrorsDisplayOptions? | Get or set optionnal error display option (if not set, application configuration will be used) |
IgnoreFormTracking | bool | Ignore form from tracking modifications. |
Model | object | Specifies the top-level model object for the form. An edit context will be constructed for this model. If using this parameter, do not also supply a value for EditContext. |
OnInvalidSubmit | EventCallback<EditContext> | A callback that will be invoked when the form is submitted and the EditContext is determined to be invalid. |
OnSubmit | EventCallback<EditContext> | A callback that will be invoked when the form is submitted. If using this parameter, you are responsible for triggering any validation manually, e.g., by calling EditContext.Validate. |
OnValidSubmit | EventCallback<EditContext> | A callback that will be invoked when the form is submitted and the EditContext is determined to be valid. |
RequiredInputDisplayMode | RequiredInputDisplayMode? | Get or set the display mode of mandory and optional fields |
SubmitOnEnter | bool | Get or set the falg indicating if the form should be submitted when enter key is pressed. (true by default) |
UseValidationComplexModel | bool? | Active a ObjectGraphDataAnnotationsValidator instead of a simple DataAnnotationsValidator (required when you have nested properties with DataAnnotation) |
ValidationErrorMessage | string | If set replace the default error message (#lgEditFormValidation) |
Cascading parameters
| Parameter | Type | Description |
|---|---|---|
FormTracker | LgFormTracker | Potential form tracker defined by an ancestor |