EFormItem Form item
Examples
Associated label and focus
Form item
Properties
contentDataaliasContent slot; declare QML child objects directly inside the component.
Alias: fieldContainer.dataenabledboolAllow interaction; false disables the control.
trueerrorstringValidation message or externally supplied error text.
""errorComponentComponentComponent slot for custom error state; null uses the default content. See this page’s examples for delegate context.
nullformvarEnclosing EForm for this form item; found through ancestors by default.
nullformDisabledboolDisabled state passed from the form to this item.
falseheightrealComponent size in pixels; may be bound to its parent layout.
implicitHeighthelpTextstringField help text.
""hideRequiredAsteriskboolHide the required-field asterisk.
falseinheritFormConfigboolInherit settings from the enclosing form.
trueinlineMessageboolDisplay validation messages inline.
falselabelstringLabel text or option identifier used for display or selection matching.
""labelComponentComponentComponent slot for custom label; null uses the default content. See this page’s examples for delegate context.
nulllabelPositionstringPosition of the form label.
left
right
top
"top"labelSuffixstringText appended to labels.
""labelWidthintLabel width in pixels.
0propstringPath of this form item in the form model.
""propagateToFieldboolPropagate disabled, size and validation settings to the field control.
truerequiredboolMark this form item as required.
falserequiredAsteriskPositionstringPosition of the required marker relative to the label.
"left" / "right"
"left"requiredMessagestringMessage for an empty required field.
Localized textresettableboolAllow form reset to reset this field.
truerowSpacingintGap between content, columns, rows or text in pixels.
6rulesvarArray of validation rules for the current field.
Fields:
required, whitespace, type
len, min, max
pattern, enum, oneOf
validator, transform, message
trigger
[]showMessageboolShow validation messages.
trueshowSuccessStateboolShow the success state after successful validation.
falsesizeintControl size; inherits the nearest EConfigProvider by default.
EStyle.SmallEStyle.MediumEStyle.Large
Inherited; EStyle.Medium by defaultvalidateEventboolRequest enclosing-form validation when the value changes.
truevalidateOnChangeboolValidate automatically when a field value changes.
falsevalidationMessagestringValidation message or externally supplied error text.
""validationStateintInput validation state.
EValidationState.NoneEValidationState.SuccessEValidationState.WarningEValidationState.Error
EValidationState.NonevalidatorvarCustom field validator returning an error message, boolean or Promise.
nullvisibleboolWhether the component is visible.
truewidthrealComponent size in pixels; may be bound to its parent layout.
implicitWidtheffectiveMessagestringRead onlyForm-item message resolved from external errors and validation.
Computed at runtimeeffectiveValidateEventboolRead onlyValidation-event setting resolved from form item and field.
Computed at runtimefieldItemRead onlyField control found inside the form item.
Computed at runtimefieldFocusedboolRead onlyWhether the field control is focused.
Computed at runtimefieldValuevarRead onlyCurrent value read from the form model or field control.
Computed at runtimehasValidationErrorboolRead onlyWhether validation state is Error.
Computed at runtimeisRequiredboolRead onlyWhether the field is required after merging required and rules.
Computed at runtimevalidatingboolRead onlyWhether asynchronous form validation is running.
Computed at runtimeSignals
validateFinished(string prop, bool valid, string message)Emitted after field validation; prop is the field path, valid is the result, and message is the validation message.
Methods
clearValidation()Clear validation messages and state without changing field values.
setInitialValue(value)Set the initial value used when this field is reset.
validateAsync(trigger, callback)Run asynchronous validation and receive the result through callback.
focusField()Focus this field input; return whether focus succeeds.
clearValidate()Clear validation messages and state without changing current data.
resetField()Restore this field to its initial value and clear validation.
validate(trigger, callback)Validate the current data; components supporting callback pass the result to that callback.