layout: default title: FieldElement parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Widgets

FieldElement Class

A FieldElement form element defines how a feature layer’s field participates in the FeatureForm. This is the recommended approach to set field configurations within a feature form’s or feature layer’s formTemplate.
ArcGIS Maps SDK for JavaScript

public class FieldElement : dymaptic.GeoBlazor.Core.Components.Widgets.FormElement

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 FormElement 🡒 FieldElement

Constructors

FieldElement() Constructor

Parameterless constructor for use as a razor component

public FieldElement();

FieldElement(string, string, string, string, string, string, string, Domain, FormInput) Constructor

Creates a new FieldElement in code with parameters

public FieldElement(string? fieldName, string? label=null, string? description=null, string? hint=null, string? editableExpression=null, string? requiredExpression=null, string? valueExpression=null, dymaptic.GeoBlazor.Core.Components.Widgets.Domain? domain=null, dymaptic.GeoBlazor.Core.Components.Widgets.FormInput? input=null);

Parameters

fieldName System.String

The field name as defined by the feature layer. Set this property to indicate which field to edit.

label System.String

The string template for defining how to format the title displayed at the top of a form.

description System.String

The description of the form.

hint System.String

Contains a hint used to help editors while editing fields. Set this as a temporary placeholder for text/number inputs in either TextAreaInput or TextBoxInput.

editableExpression System.String

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Constraint Profile. Expressions may reference field values using the $feature global input and must return either true or false.

requiredExpression System.String

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Constraint Profile. Expressions may reference field values using the $feature global input and must return either true or false.

valueExpression System.String

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Calculation Profile. This expression references field values within an individual feature or in other layers and must return either a date, number, or string value.

domain Domain

The coded value domain or range domain of the field.

input FormInput

The input to use for the element. The client application is responsible for defining the default user interface.

Properties

FieldElement.Domain Property

The coded value domain or range domain of the field.

public dymaptic.GeoBlazor.Core.Components.Widgets.Domain? Domain { get; set; }

Property Value

Domain

FieldElement.EditableExpression Property

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Constraint Profile. Expressions may reference field values using the $feature global input and must return either true or false.

public string? EditableExpression { get; set; }

Property Value

System.String

Remarks

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Constraint Profile. Expressions may reference field values using the $feature global input and must return either true or false.
The referenced expression must be defined in the form template’s expressionInfos. It cannot be set inline within the element object.

FieldElement.FieldName Property

The field name as defined by the feature layer. Set this property to indicate which field to edit.

public string? FieldName { get; set; }

Property Value

System.String

FieldElement.Hint Property

Contains a hint used to help editors while editing fields. Set this as a temporary placeholder for text/number inputs in either TextAreaInput or TextBoxInput.

public string? Hint { get; set; }

Property Value

System.String

FieldElement.Input Property

The input to use for the element. The client application is responsible for defining the default user interface.

public dymaptic.GeoBlazor.Core.Components.Widgets.FormInput? Input { get; set; }

Property Value

FormInput

FieldElement.RequiredExpression Property

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Constraint Profile. Expressions may reference field values using the $feature global input and must return either true or false.
When this expression evaluates to true and the field value is required, the element must have a valid value in order for the feature to be created or edited. When the expression evaluates to false, the element is not required. If no expression is provided, the required behavior is defined via the required property.
If the referenced field is non-nullable, the requiredExpression is ignored and the element is always required.

public string? RequiredExpression { get; set; }

Property Value

System.String

Remarks

The referenced expression must be defined in the form template’s expressionInfos. It cannot be set inline within the element object.

FieldElement.Type Property

Indicates the type of form element.

public override string Type { get; }

Property Value

System.String

FieldElement.ValueExpression Property

A reference to the name of an Arcade expression defined in the expressionInfos of the FormTemplate. The expression must follow the specification defined in the Form Calculation Profile. This expression references field values within an individual feature or in other layers and must return either a date, number, or string value.

public string? ValueExpression { get; set; }

Property Value

System.String

Remarks

Once the expression evaluates, the form’s field value updates to the expressions’ result.
It is required to set the view property when instantiating a FeatureForm widget and using expressions that use the $map variable.
The referenced expression must be defined in the form template’s expressionInfos. It cannot be set inline within the element object.

Methods

FieldElement.RegisterChildComponent(MapComponent) Method

Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.

public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The calling, child component to register

Returns

System.Threading.Tasks.Task

Exceptions

InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.

Remarks

This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.

FieldElement.UnregisterChildComponent(MapComponent) Method

Undoes the “Registration” of a child with its parent.

public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The child to unregister

Returns

System.Threading.Tasks.Task

Remarks

This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.