A form element that defines a field in the feature table. More...
Header | #include <Field |
Since | Esri |
Inherits | Esri |
Public Functions
virtual | ~ |
Esri | domain() const |
Q | field |
Esri | field |
Q | formatted |
Q | hint() const |
Esri | input() const |
bool | is |
bool | is |
bool | is |
void | update |
Q | validation |
Q | value() const |
Signals
void | editable |
void | required |
void | validation |
void | value |
Detailed Description
The FieldFormElement specifies a field for display on the form. It can also define the user interface for editing values for the field and Arcade expressions to manage element display and behavior.
Member Function Documentation
[override virtual noexcept]
FieldFormElement::~FieldFormElement ()
Destructor.
Esri::ArcGISRuntime::Domain FieldFormElement::domain() const
Returns the domain to apply to this field.
If defined, this takes precedence over domains defined for the field, type, or subtype.
[signal]
void FieldFormElement::editableChanged (bool isEditable )
Signal emitted when the editable state changes.
- isEditable - The new editable state of the field form element.
QString FieldFormElement::fieldName () const
Returns the name of the field associated with this element in the FeatureTable::fields array.
Esri::ArcGISRuntime::FieldType FieldFormElement::fieldType () const
Returns the field type of the field associated with this element in the FeatureTable::fields array.
QString FieldFormElement::formattedValue () const
Returns the formatted value for the field specified by fieldName.
This property is updated when FeatureForm::evaluateExpressionsAsync is called unless isEditable is true
. Dates and times are returned in the local timezone. If a field is part of a CodedValueDomain, CodedValue::name is returned.
QString FieldFormElement::hint() const
Returns placeholder text that can be applied to text or numeric inputs.
Esri::ArcGISRuntime::FormInput *FieldFormElement::input() const
Returns the input user interface to use for the element.
If the client application does not understand the supplied input, the client application is responsible for defining the default user interface.
bool FieldFormElement::isEditable () const
Returns true
if the element is editable. false
if the element is not editable.
This property can be modified by the editable expression, which can be set during Feature Form authoring.
bool FieldFormElement::isHasValueExpression () const
Returns true
if the element has a value expression, false
otherwise.
bool FieldFormElement::isRequired () const
Returns true
if the element is required. false
if the element is not required.
This property is always true
if the fieldName is the ArcGISFeatureTable::typeIdField or the field is non-nullable. Otherwise, it depends on the result of the required expression. Additionally, if isVisible is false
, the required expression is ignored and false
is returned.
[signal]
void FieldFormElement::requiredChanged (bool isRequired )
Signal emitted when the required state changes.
- isRequired - The new required state of the field form element.
void FieldFormElement::updateValue (const QVariant &value)
Updates the value of a field in the feature associated with the FieldFormElement.
- value - The value with which to update the Field.
This function expects you to pass at least the correct type of value for the field. After the value is updated, FeatureForm::evaluateExpressionsAsync should be called in order to update any dependent properties. After the value has been updated, the list of validation errors will be updated and the validationErrorsChanged event will be fired if the list of errors has changed.
QList <Esri::ArcGISRuntime::Error > FieldFormElement::validationErrors () const
Returns an array of errors collected when the value is validated. An empty array indicates the element's value is valid.
The constraints depend on the type of input. For example a FieldFormElement with an input type of TextBoxFormInput may not be empty if the value of isRequired is true
. The errors returned can be any of the following error types:
- ErrorType::FeatureFormNullNotAllowedError
- ErrorType::FeatureFormIncorrectValueTypeError
- ErrorType::FeatureFormExceedsMaximumDateTimeError
- ErrorType::FeatureFormLessThanMinimumDateTimeError
- ErrorType::FeatureFormExceedsMaximumLengthError
- ErrorType::FeatureFormLessThanMinimumLengthError
- ErrorType::FeatureFormExceedsNumericMaximumError
- ErrorType::FeatureFormLessThanNumericMinimumError
- ErrorType::FeatureFormNotInCodedValueDomainError
- ErrorType::FeatureFormFieldIsRequiredError
See also FormInput and FeatureForm::validationErrors.
[signal]
void FieldFormElement::validationErrorsChanged (const QList <Esri::ArcGISRuntime::Error > &errors)
Signal emitted when the validation errors change.
- errors - The new validation errors of the field form element.
QVariant FieldFormElement::value() const
Returns the attribute value for the field specified by fieldName.
If the field is part of a CodedValueDomain, the CodedValue::code is returned (unlike formattedValue, which returns the CodedValue::name).
[signal]
void FieldFormElement::valueChanged (const QVariant &value)
Signal emitted when the value changes.
- value - The new value of the field form element.