aem-forms-af-runtime

Interface: FormModel

Defines the interface for form model

Hierarchy

Implemented by

Table of contents

Properties

Methods

Properties

:type

• Readonly :type: string

Custom widget type show to the user for capturing the data.

Inherited from

ContainerModel.:type


_eventSource

• _eventSource: EventSource

Inherited from

ContainerModel._eventSource


accept

• Optional accept: string[]

Inherited from

ContainerModel.accept


activeChild

• activeChild: null | BaseModel

Inherited from

ContainerModel.activeChild


activeField

• activeField: FieldModel


changeEventBehaviour

• Readonly changeEventBehaviour: "deps" | "self"


data

• Optional Readonly data: any

Form data


dataRef

• Optional Readonly dataRef: null | string

To map the field’s value to a property in the data model.

Inherited from

ContainerModel.dataRef


default

• Optional Readonly default: any

Default value of the Field.

Inherited from

ContainerModel.default


description

• Optional description: string

Extra description to be shown to the user to aid in form filling experience. It can be rich text.

Inherited from

ContainerModel.description


enabled

• Optional enabled: boolean

Whether the field is enabled and takes part in rules, events etc.

Inherited from

ContainerModel.enabled


enforceEnum

• Optional enforceEnum: boolean

Inherited from

ContainerModel.enforceEnum


enum

• Optional enum: any[]

Inherited from

ContainerModel.enum


enumNames

• Optional enumNames: string[]

Inherited from

ContainerModel.enumNames


events

• Optional events: Object

Events is a dictionary of eventName to the actions to perform.

Index signature

▪ [key: string]: string

Inherited from

ContainerModel.events


exclusiveMaximum

• Optional exclusiveMaximum: string | number

Inherited from

ContainerModel.exclusiveMaximum


exclusiveMinimum

• Optional exclusiveMinimum: string | number

Inherited from

ContainerModel.exclusiveMinimum


fieldType

• Readonly fieldType: string

Type of field to capture the user data.

Inherited from

ContainerModel.fieldType


format

• Optional format: string

Inherited from

ContainerModel.format


fragment

• Readonly fragment: string

Inherited from

ContainerModel.fragment


id

• Readonly id: string

Id of the form.

Overrides

ContainerModel.id


index

• Readonly index: number

The index of the Field within its parent.

Inherited from

ContainerModel.index


isContainer

• Readonly isContainer: boolean

Whether the form field is container or not

Inherited from

ContainerModel.isContainer


isFragment

• isFragment: boolean

Inherited from

ContainerModel.isFragment


items

• items: (FieldModel | FieldsetModel)[]

Defines the children/items of the container

Inherited from

ContainerModel.items


label

• Optional label: Label

Label to be used for the field.

Inherited from

ContainerModel.label


lang

• Optional Readonly lang: string

language of the field

Inherited from

ContainerModel.lang


logger

• Readonly logger: Logger


maxFileSize

• Optional maxFileSize: string | number

Inherited from

ContainerModel.maxFileSize


maxItems

• Optional maxItems: number

Inherited from

ContainerModel.maxItems


maxLength

• Optional maxLength: number

Inherited from

ContainerModel.maxLength


maxOccur

• Optional maxOccur: number

Inherited from

ContainerModel.maxOccur


maximum

• Optional maximum: string | number

Inherited from

ContainerModel.maximum


metadata

• Optional Readonly metadata: MetaDataJson

Form metadata


minItems

• Optional minItems: number

Inherited from

ContainerModel.minItems


minLength

• Optional minLength: number

Inherited from

ContainerModel.minLength


minOccur

• Optional minOccur: number

Inherited from

ContainerModel.minOccur


minimum

• Optional minimum: string | number

Inherited from

ContainerModel.minimum


name

• Optional Readonly name: string

Name of the form field.

Inherited from

ContainerModel.name


parent

• parent: ContainerModel

Defines the parent of the container

Inherited from

ContainerModel.parent


pattern

• Optional pattern: string

Inherited from

ContainerModel.pattern


placeholder

• Optional placeholder: string

The placeholder to show on the widget.

Inherited from

ContainerModel.placeholder


propDependencyBehaviour

• Readonly propDependencyBehaviour: "strict" | "any"


properties

• properties: Object

Custom properties of the form field.

Index signature

▪ [key: string]: any

Inherited from

ContainerModel.properties


qualifiedName

• Readonly qualifiedName: string

Inherited from

ContainerModel.qualifiedName


readOnly

• Optional readOnly: boolean

Whether the field should be readOnly to end user or not.

Inherited from

ContainerModel.readOnly


repeatable

• Optional Readonly repeatable: boolean

Field is repeatable or not

Inherited from

ContainerModel.repeatable


required

• Optional required: boolean

Inherited from

ContainerModel.required


rules

• Optional rules: Object

Rules that modify the property of the object dynamically. The rules are evaluated whenever the dependency changes.

Index signature

▪ [key: string]: string

Inherited from

ContainerModel.rules


specVersion

• Readonly specVersion: Version


step

• Optional step: number

Inherited from

ContainerModel.step


title

• Readonly title: string

Form title.


type

• Optional type: string

Inherited from

ContainerModel.type


uniqueItems

• Optional uniqueItems: boolean

Inherited from

ContainerModel.uniqueItems


valid

• Optional valid: boolean

The current validation state of the Field. The property is always computed after merging the Data Model with the Form

Inherited from

ContainerModel.valid


validationExpression

• Optional validationExpression: string

Inherited from

ContainerModel.validationExpression


value

• value: any

The current value of the Field. The property is serialized in the Data Model.

Inherited from

ContainerModel.value


visible

• Optional visible: boolean

Whether the field should be visible to author or not.

Inherited from

ContainerModel.visible

Methods

exportData

▸ exportData(): any

Exports the form data

Returns

any


fieldAdded

▸ fieldAdded(field): void

Parameters

Name Type
field FieldModel | FieldsetModel

Returns

void


getElement

▸ getElement(id): FormModel | FieldModel | FieldsetModel

Get form element model based on the id of the form element

Parameters

Name Type Description
id string id of the form element

Returns

FormModel | FieldModel | FieldsetModel


getState

▸ getState(forRestore?): any

state of the form object

Parameters

Name Type
forRestore? boolean

Returns

any

Inherited from

WithState.getState


importData

▸ importData(data): any

Imports the given form data

Parameters

Name Type Description
data any form data

Returns

any

Inherited from

ContainerModel.importData


indexOf

▸ indexOf(f): number

Returns the index of the child item or the child container

Parameters

Name Type Description
f FieldModel | FieldsetModel child item

Returns

number

index of the item

Inherited from

ContainerModel.indexOf


isTransparent

▸ isTransparent(): boolean

Returns

boolean

Inherited from

ContainerModel.isTransparent


reset

▸ reset(): any

Resets the form model

Returns

any

Inherited from

ContainerModel.reset


resolveQualifiedName

▸ resolveQualifiedName(qualifiedName): null | FieldModel | FieldsetModel

Resolves a form element by its qualified name.

see FieldModel

see FieldsetModel

Parameters

Name Type Description
qualifiedName string The qualified name to resolve.

Returns

null | FieldModel | FieldsetModel

The resolved form element, or null if not found.


syncDataAndFormModel

▸ syncDataAndFormModel(a?): any

Parameters

Name Type
a? default | default

Returns

any

Inherited from

ContainerModel.syncDataAndFormModel


validate

▸ validate(): ValidationError[]

Validates the given form field

Returns

ValidationError[]

list of validation errors

Inherited from

ContainerModel.validate


visit

▸ visit(callBack): void

visits each element in the form

Parameters

Name Type Description
callBack (field: FieldModel | FieldsetModel) => void a function which is invoked on each form element (including container type elements) visited

Returns

void