FeatureForm

Defines the user interface (form configuration) to display when editing a feature. A web map may define forms for editing features in a feature layer. A layer's form definition is available from the com.arcgismaps.mapping.layers.FeatureLayer.featureFormDefinition and can be used to create a feature form.

Since

200.4.0

Constructors

Link copied to clipboard
constructor(feature: ArcGISFeature)

Creates a FeatureForm for the com.arcgismaps.data.ArcGISFeature. If the feature's com.arcgismaps.mapping.layers.FeatureLayer, com.arcgismaps.data.ArcGISFeatureTable, or the com.arcgismaps.mapping.layers.SubtypeSublayer specific to the feature's com.arcgismaps.data.FeatureSubtype has been authored with a FeatureFormDefinition, then this authored FeatureFormDefinition will be used to create the FeatureForm. If a FeatureFormDefinition is not found, a default definition is generated and used to create the FeatureForm.

constructor(feature: ArcGISFeature, definition: FeatureFormDefinition)

Create a form that contains a user interface for editing the specified feature.

Properties

Link copied to clipboard

A default AttachmentsFormElement for displaying and editing the feature's attachments. Few of the tools used to author a FeatureForm support adding attachment elements. This default AttachmentsFormElement can be used to provide a default attachment editing experience to the users of your app, in lieu of an element from the authoring environment.

Link copied to clipboard

The feature form definition used to define the user interface for the form.

Link copied to clipboard

A description of the form.

Link copied to clipboard

An ordered list of the elements contained by the form.

Link copied to clipboard

The feature displayed in the form.

Link copied to clipboard

If true, the value for a previously visible FieldFormElement is retained when it (or its parent) is hidden. The default is false, meaning the value is cleared when an element is hidden.

Link copied to clipboard
val title: StateFlow<String>

The form title.

Link copied to clipboard

A dictionary mapping from FieldFormElement.fieldName to an array of errors. An empty dictionary indicates that all element's values are valid. Constraints are expressed by the FormInput and the value of FieldFormElement.isRequired of the element. The constraints depend on the type of FormInput. The errors returned for each key is an array of any of the following types:

Functions

Link copied to clipboard

Discards edits to FeatureForm.elements and their associated com.arcgismaps.data.Feature.attributes. Edits are discarded but the Feature is not refreshed. Values will be reset to the values at the time of FeatureForm creation.

Link copied to clipboard

Asynchronously evaluates all form expressions. An expression can include Arcade FeatureSet functions, which need to be evaluated asynchronously. Upon completion the task provides a set of FormExpressionEvaluationError providing diagnostic information about errors encountered during evaluation of expressions. An empty list indicates no errors were encountered.

Link copied to clipboard
suspend fun finishEditing(): Result<Unit>

Saves edits made using the FeatureForm to the database. Commits changes to the com.arcgismaps.data.ArcGISFeature and its attachments to the database. Note that calling com.arcgismaps.data.FeatureTable.updateFeature manually is not required.