aem-forms-af-runtime

Class: Field

Hierarchy

Implements

Table of contents

Accessors

Properties

Methods

Accessors

:type

get :type(): string

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

Returns

string

Implementation of

FieldModel.:type

Inherited from

Scriptable.:type


dataRef

get dataRef(): undefined | null | string

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

Returns

undefined | null | string

Implementation of

FieldModel.dataRef

Inherited from

Scriptable.dataRef


default

get default(): any

Default value of the Field.

Returns

any

Implementation of

FieldModel.default


description

get description(): undefined | string

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

Returns

undefined | string

Implementation of

FieldModel.description

Inherited from

Scriptable.description

set description(d): void

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

Parameters

Name Type
d undefined | string

Returns

void

Implementation of

FieldModel.description

Inherited from

Scriptable.description


displayFormat

get displayFormat(): undefined | string

format in which user will see the value after update

Returns

undefined | string

Implementation of

FieldModel.displayFormat


displayValue

get displayValue(): any

value to be displayed to the user after update

Returns

any

Implementation of

FieldModel.displayValue


displayValueExpression

get displayValueExpression(): undefined | string

expression that when evaluated returns the displayValue of a field

Returns

undefined | string

Implementation of

FieldModel.displayValueExpression


editFormat

get editFormat(): undefined | string

format in which user will edit the value

Returns

undefined | string

Implementation of

FieldModel.editFormat


editValue

get editValue(): any

value to be displayed to the user for edit

Returns

any

Implementation of

FieldModel.editValue


emptyValue

get emptyValue(): undefined | null | ""

Returns

undefined | null | ""


enabled

get enabled(): undefined | boolean

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

Returns

undefined | boolean

Implementation of

FieldModel.enabled

set enabled(e): void

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

Parameters

Name Type
e undefined | boolean

Returns

void

Implementation of

FieldModel.enabled


enforceEnum

get enforceEnum(): undefined | boolean

Returns

undefined | boolean

Implementation of

FieldModel.enforceEnum


enum

get enum(): undefined | any[]

Returns

undefined | any[]

Implementation of

FieldModel.enum

set enum(e): void

Parameters

Name Type
e undefined | any[]

Returns

void

Implementation of

FieldModel.enum


enumNames

get enumNames(): undefined | string[]

Returns

undefined | string[]

Implementation of

FieldModel.enumNames

set enumNames(e): void

Parameters

Name Type
e undefined | string[]

Returns

void

Implementation of

FieldModel.enumNames


errorMessage

get errorMessage(): undefined | string

Returns

undefined | string

set errorMessage(e): void

Parameters

Name Type
e undefined | string

Returns

void


exclusiveMaximum

get exclusiveMaximum(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.exclusiveMaximum

set exclusiveMaximum(eM): void

Parameters

Name Type
eM undefined | number

Returns

void

Implementation of

FieldModel.exclusiveMaximum


exclusiveMinimum

get exclusiveMinimum(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.exclusiveMinimum

set exclusiveMinimum(eM): void

Parameters

Name Type
eM undefined | number

Returns

void

Implementation of

FieldModel.exclusiveMinimum


fieldType

get fieldType(): string

Type of field to capture the user data.

Returns

string

Implementation of

FieldModel.fieldType

Inherited from

Scriptable.fieldType


form

get form(): FormModel

Returns

FormModel

Inherited from

Scriptable.form


format

get format(): undefined | string

returns the format constraint

Returns

undefined | string

Implementation of

FieldModel.format


fragment

get fragment(): string

Returns

string

Implementation of

FieldModel.fragment

Inherited from

Scriptable.fragment


id

get id(): string

Unique id of the form field.

Returns

string

Implementation of

FieldModel.id

Inherited from

Scriptable.id


index

get index(): number

The index of the Field within its parent.

Returns

number

Implementation of

FieldModel.index

Inherited from

Scriptable.index


isContainer

get isContainer(): boolean

Whether the form field is container or not

Returns

boolean

Implementation of

FieldModel.isContainer

Inherited from

Scriptable.isContainer


label

get label(): undefined | Label

Label to be used for the field.

Returns

undefined | Label

Implementation of

FieldModel.label

Inherited from

Scriptable.label

set label(l): void

Label to be used for the field.

Parameters

Name Type
l undefined | Label

Returns

void

Implementation of

FieldModel.label

Inherited from

Scriptable.label


lang

get lang(): undefined | string

language of the field

Returns

undefined | string

Implementation of

FieldModel.lang

Inherited from

Scriptable.lang


maxLength

get maxLength(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.maxLength


maximum

get maximum(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.maximum

set maximum(m): void

Parameters

Name Type
m undefined | number

Returns

void

Implementation of

FieldModel.maximum


minLength

get minLength(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.minLength


minimum

get minimum(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.minimum

set minimum(m): void

Parameters

Name Type
m undefined | number

Returns

void

Implementation of

FieldModel.minimum


name

get name(): undefined | string

Name of the form field.

Returns

undefined | string

Implementation of

FieldModel.name

Inherited from

Scriptable.name


parent

get parent(): ContainerModel

Parent of the current field

Returns

ContainerModel

Implementation of

FieldModel.parent

Inherited from

Scriptable.parent


pattern

get pattern(): undefined | string

Returns

undefined | string

Implementation of

FieldModel.pattern


placeholder

get placeholder(): undefined | string

The placeholder to show on the widget.

Returns

undefined | string

Implementation of

FieldModel.placeholder


properties

get properties(): Object

Custom properties of the form field.

Returns

Object

Implementation of

FieldModel.properties

Inherited from

Scriptable.properties

set properties(p): void

Custom properties of the form field.

Parameters

Name Type
p Object

Returns

void

Implementation of

FieldModel.properties

Inherited from

Scriptable.properties


qualifiedName

get qualifiedName(): any

Returns

any

Implementation of

FieldModel.qualifiedName

Inherited from

Scriptable.qualifiedName


readOnly

get readOnly(): undefined | boolean

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

Returns

undefined | boolean

Implementation of

FieldModel.readOnly

set readOnly(e): void

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

Parameters

Name Type
e undefined | boolean

Returns

void

Implementation of

FieldModel.readOnly


repeatable

get repeatable(): any

Field is repeatable or not

Returns

any

Implementation of

FieldModel.repeatable

Inherited from

Scriptable.repeatable


required

get required(): boolean

Returns

boolean

Implementation of

FieldModel.required

set required(r): void

Parameters

Name Type
r boolean

Returns

void

Implementation of

FieldModel.required


ruleEngine

get ruleEngine(): RuleEngine

Returns

RuleEngine

Implementation of

FieldModel.ruleEngine

Inherited from

Scriptable.ruleEngine


screenReaderText

get screenReaderText(): undefined | string

Returns

undefined | string

Inherited from

Scriptable.screenReaderText


step

get step(): undefined | number

Returns

undefined | number

Implementation of

FieldModel.step


tooltip

get tooltip(): undefined | string

Returns

undefined | string


type

get type(): undefined | string

Returns

undefined | string

Implementation of

FieldModel.type

Inherited from

Scriptable.type


uniqueItems

get uniqueItems(): undefined | boolean

Returns

undefined | boolean

Implementation of

FieldModel.uniqueItems

Inherited from

Scriptable.uniqueItems


valid

get valid(): any

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

Returns

any

Implementation of

FieldModel.valid

set valid(e): void

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

Parameters

Name Type
e any

Returns

void

Implementation of

FieldModel.valid


validity

get validity(): any

Returns

any


value

get value(): any

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

Returns

any

Implementation of

FieldModel.value

Overrides

Scriptable.value

set value(v): void

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

Parameters

Name Type
v any

Returns

void

Implementation of

FieldModel.value

Overrides

Scriptable.value


visible

get visible(): undefined | boolean

Whether the field should be visible to author or not.

Returns

undefined | boolean

Implementation of

FieldModel.visible

Inherited from

Scriptable.visible

set visible(v): void

Whether the field should be visible to author or not.

Parameters

Name Type
v undefined | boolean

Returns

void

Implementation of

FieldModel.visible

Inherited from

Scriptable.visible

Properties

_eventSource

_eventSource: EventSource = EventSource.CODE

Implementation of

FieldModel._eventSource

Inherited from

Scriptable._eventSource

Methods

change

change(event, context): void

Parameters

Name Type
event Action
context any

Returns

void

Inherited from

Scriptable.change


dispatch

dispatch(action): void

Parameters

Name Type
action Action

Returns

void

Implementation of

FieldModel.dispatch

Inherited from

Scriptable.dispatch


executeAction

executeAction(action): void

Executes the given action

Parameters

Name Type Description
action Action event object

Returns

void

Inherited from

Scriptable.executeAction


executeExpression

executeExpression(expr): any

Parameters

Name Type
expr string

Returns

any

Inherited from

Scriptable.executeExpression


focus

focus(): void

Returns

void

Inherited from

Scriptable.focus


getDependents

getDependents(): string[]

Returns

string[]

Inherited from

Scriptable.getDependents


getErrorMessage

getErrorMessage(constraint): string

Returns the error message for a given constraint

Parameters

Name Type
constraint keyof ConstraintsMessages

Returns

string


getNonTransparentParent

getNonTransparentParent(): ContainerModel

Returns

ContainerModel

Inherited from

Scriptable.getNonTransparentParent


getRules

getRules(): Items<string>

Returns

Items<string>

Inherited from

Scriptable.getRules


getState

getState(isRepeatableChild?, forRestore?): Object

state of the form object

Parameters

Name Type Default value
isRepeatableChild boolean false
forRestore boolean false

Returns

Object

Name Type
:type string
_dependents undefined | string[]
accept? string[]
allowedComponents undefined
altText? string
appliedCssClassNames? string
buttonType? string
checked? boolean
columnClassNames undefined
columnCount undefined
constraintMessages? ConstraintsMessages
dataRef? null | string
default? any
description? string
displayFormat undefined | string
displayValue any
displayValueExpression? string
editFormat undefined | string
editValue any
emptyValue? "" | "undefined" | "null"
enabled undefined | boolean
enforceEnum? boolean
enum? any[]
enumNames? string[]
errorMessage? string
events? Items<undefined | string | string[]>
exclusiveMaximum? number
exclusiveMinimum? number
fieldType? string
format? string
gridClassNames undefined
id string
index number
label? Label
lang? string
maxFileSize? string | number
maxItems? number
maxLength? number
maxOccur? number
maximum? number
minItems? number
minLength? number
minOccur? number
minimum? number
name? string
parent undefined
pattern? string
placeholder? string
properties { [key: string]: any; }
qualifiedName any
readOnly undefined | boolean
repeatable? boolean
required? boolean
rules? Items<string>
screenReaderText? string
step? number
tooltip? string
type? string
uniqueItems? boolean
valid? boolean
validationExpression? string
validationMessage? string
validity? any
value? any
viewType? string
visible? boolean

Implementation of

FieldModel.getState

Overrides

Scriptable.getState


isTransparent

isTransparent(): boolean

Transparent form fields are meant only for creation of view. They are also not part of data

Returns

boolean

Inherited from

Scriptable.isTransparent


markAsInvalid

markAsInvalid(message, constraint?): void

API to mark a particular field as invalid

Parameters

Name Type Default value Description
message string undefined error message
constraint null | keyof ConstraintsMessages null constraint type due to which field is marked invalid. It should be key of ConstraintsMessages or null

Returns

void


ruleNodeReference

ruleNodeReference(): any

Returns

any

Implementation of

FieldModel.ruleNodeReference

Overrides

Scriptable.ruleNodeReference


syncDataAndFormModel

syncDataAndFormModel(dataNode): void

Parameters

Name Type
dataNode default

Returns

void

Implementation of

FieldModel.syncDataAndFormModel

Overrides

Scriptable.syncDataAndFormModel


toString

toString(): any

Returns

any


triggerValidationEvent

triggerValidationEvent(changes): void

Parameters

Name Type
changes any

Returns

void


validate

validate(): ValidationError[]

Validates the current form object

Returns

ValidationError[]

Implementation of

FieldModel.validate

Overrides

Scriptable.validate


valueOf

valueOf(): any

Returns

any