Interface IFieldGenerator
Generates the HTML for a single form field.
Namespace: ChameleonForms.FieldGenerators
Assembly: ChameleonForms.Core.dll
Syntax
public interface IFieldGenerator
Properties
| Improve this Doc View SourceMetadata
The metadata for the form field.
Declaration
ModelMetadata Metadata { get; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata |
Template
The form template that will be used to render the form.
Declaration
IFormTemplate Template { get; }
Property Value
Type | Description |
---|---|
IFormTemplate |
Methods
| Improve this Doc View SourceGetFieldHtml(IFieldConfiguration)
Creates the HTML for the field control after preparing the given field configuration.
Declaration
IHtmlContent GetFieldHtml(IFieldConfiguration fieldConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IFieldConfiguration | fieldConfiguration |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the field control |
GetFieldHtml(IReadonlyFieldConfiguration)
Creates the HTML for the field control.
Declaration
IHtmlContent GetFieldHtml(IReadonlyFieldConfiguration fieldConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IReadonlyFieldConfiguration | fieldConfiguration |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the field control |
GetFieldId()
Returns the id of the field being generated.
Declaration
string GetFieldId()
Returns
Type | Description |
---|---|
System.String | The id |
GetLabelHtml(IFieldConfiguration)
Creates the HTML for the field label after preparing the given field configuration.
Declaration
IHtmlContent GetLabelHtml(IFieldConfiguration fieldConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IFieldConfiguration | fieldConfiguration |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the field label |
GetLabelHtml(IReadonlyFieldConfiguration)
Creates the HTML for the field label.
Declaration
IHtmlContent GetLabelHtml(IReadonlyFieldConfiguration fieldConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IReadonlyFieldConfiguration | fieldConfiguration |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the field label |
GetValidationHtml(IFieldConfiguration)
Creates the HTML for the field's validation messages after preparing the given field configuration.
Declaration
IHtmlContent GetValidationHtml(IFieldConfiguration fieldConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IFieldConfiguration | fieldConfiguration |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the field's validation messages |
GetValidationHtml(IReadonlyFieldConfiguration)
Creates the HTML for the field's validation messages
Declaration
IHtmlContent GetValidationHtml(IReadonlyFieldConfiguration fieldConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IReadonlyFieldConfiguration | fieldConfiguration |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the field's validation messages |
PrepareFieldConfiguration(IFieldConfiguration, FieldParent)
Turns the given IFieldConfiguration into a FieldConfiguration ready to use for generating the form field.
Declaration
IReadonlyFieldConfiguration PrepareFieldConfiguration(IFieldConfiguration fieldConfiguration, FieldParent fieldParent)
Parameters
Type | Name | Description |
---|---|---|
IFieldConfiguration | fieldConfiguration | The field configuration to modify |
FieldParent | fieldParent | The parent component of the field |
Returns
Type | Description |
---|---|
IReadonlyFieldConfiguration | The readonly field configuration; ready for generating the form field |