aem-forms-af-runtime

Class: Container<T>

Defines a generic container class which any form container should extend from.

Type parameters

Name Type Description
T extends ContainerJson & RulesJson type of the node which extends ContainerJson and RulesJson

Hierarchy

Implements

Table of contents

Accessors

Methods

Properties

Constructors

Accessors

:type

get :type(): string

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

Returns

string

Implementation of

ContainerModel.:type

Inherited from

Scriptable.:type


activeChild

get activeChild(): null | BaseModel

Returns

null | BaseModel

Implementation of

ContainerModel.activeChild

set activeChild(c): void

Parameters

Name Type
c null | BaseModel

Returns

void

Implementation of

ContainerModel.activeChild


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

ContainerModel.dataRef

Inherited from

Scriptable.dataRef


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

ContainerModel.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

ContainerModel.description

Inherited from

Scriptable.description


enabled

get enabled(): undefined | boolean

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

Returns

undefined | boolean

Implementation of

ContainerModel.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

ContainerModel.enabled


fieldType

get fieldType(): string

Type of field to capture the user data.

Returns

string

Implementation of

ContainerModel.fieldType

Inherited from

Scriptable.fieldType


form

get form(): FormModel

Returns

FormModel

Inherited from

Scriptable.form


fragment

get fragment(): string

Returns

string

Implementation of

ContainerModel.fragment

Inherited from

Scriptable.fragment


id

get id(): string

Unique id of the form field.

Returns

string

Implementation of

ContainerModel.id

Inherited from

Scriptable.id


index

get index(): number

The index of the Field within its parent.

Returns

number

Implementation of

ContainerModel.index

Inherited from

Scriptable.index


isContainer

get isContainer(): boolean

Whether the form field is container or not

Returns

boolean

Implementation of

ContainerModel.isContainer

Overrides

Scriptable.isContainer


isFragment

get isFragment(): any

Returns

any

Implementation of

ContainerModel.isFragment


items

get items(): (FieldModel | FieldsetModel)[]

Defines the children/items of the container

Returns

(FieldModel | FieldsetModel)[]

Implementation of

ContainerModel.items


label

get label(): undefined | Label

Label to be used for the field.

Returns

undefined | Label

Implementation of

ContainerModel.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

ContainerModel.label

Inherited from

Scriptable.label


lang

get lang(): undefined | string

language of the field

Returns

undefined | string

Implementation of

ContainerModel.lang

Inherited from

Scriptable.lang


maxItems

get maxItems(): number

Returns

number

Implementation of

ContainerModel.maxItems

set maxItems(m): void

Parameters

Name Type
m number

Returns

void

Implementation of

ContainerModel.maxItems


minItems

get minItems(): number

Returns

number

Implementation of

ContainerModel.minItems

set minItems(m): void

Parameters

Name Type
m number

Returns

void

Implementation of

ContainerModel.minItems


name

get name(): undefined | string

Name of the form field.

Returns

undefined | string

Implementation of

ContainerModel.name

Inherited from

Scriptable.name


parent

get parent(): ContainerModel

Defines the parent of the container

Returns

ContainerModel

Implementation of

ContainerModel.parent

Inherited from

Scriptable.parent


properties

get properties(): Object

Custom properties of the form field.

Returns

Object

Implementation of

ContainerModel.properties

Inherited from

Scriptable.properties

set properties(p): void

Custom properties of the form field.

Parameters

Name Type
p Object

Returns

void

Implementation of

ContainerModel.properties

Inherited from

Scriptable.properties


qualifiedName

get qualifiedName(): any

Returns

any

Implementation of

ContainerModel.qualifiedName

Inherited from

Scriptable.qualifiedName


readOnly

get readOnly(): any

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

Returns

any

Implementation of

ContainerModel.readOnly

set readOnly(e): void

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

Parameters

Name Type
e any

Returns

void

Implementation of

ContainerModel.readOnly


repeatable

get repeatable(): any

Field is repeatable or not

Returns

any

Implementation of

ContainerModel.repeatable

Inherited from

Scriptable.repeatable


ruleEngine

get ruleEngine(): RuleEngine

Returns

RuleEngine

Implementation of

ContainerModel.ruleEngine

Inherited from

Scriptable.ruleEngine


screenReaderText

get screenReaderText(): undefined | string

Returns

undefined | string

Inherited from

Scriptable.screenReaderText


type

get type(): undefined | string

Returns

undefined | string

Implementation of

ContainerModel.type

Inherited from

Scriptable.type


uniqueItems

get uniqueItems(): undefined | boolean

Returns

undefined | boolean

Implementation of

ContainerModel.uniqueItems

Inherited from

Scriptable.uniqueItems


visible

get visible(): undefined | boolean

Whether the field should be visible to author or not.

Returns

undefined | boolean

Implementation of

ContainerModel.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

ContainerModel.visible

Inherited from

Scriptable.visible

Methods

_canHaveRepeatingChildren

_canHaveRepeatingChildren(mode?): boolean

Parameters

Name Type Default value
mode FormCreationMode 'create'

Returns

boolean


change

change(event, context): void

Parameters

Name Type
event Action
context any

Returns

void

Inherited from

Scriptable.change


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


getNonTransparentParent

getNonTransparentParent(): ContainerModel

Returns

ContainerModel

Inherited from

Scriptable.getNonTransparentParent


getRules

getRules(): Items<string>

Returns

Items<string>

Inherited from

Scriptable.getRules


getState

getState(isRepeatableChild?, forRestore?): T & { :items: undefined = undefined; :itemsOrder: undefined = undefined; :type: string ; _dependents: undefined | string[] ; allowedComponents: undefined = undefined; columnClassNames: undefined = undefined; columnCount: undefined = undefined; enabled: undefined | boolean ; gridClassNames: undefined = undefined; id: string ; index: number ; items: any[] ; maxOccur: undefined | number ; minOccur: undefined | number ; parent: undefined = undefined; properties: { [key: string]: any; } ; qualifiedName: any ; readOnly: any ; repeatable: undefined | boolean = true }

Returns the current container state

Parameters

Name Type Default value
isRepeatableChild boolean false
forRestore boolean false

Returns

T & { :items: undefined = undefined; :itemsOrder: undefined = undefined; :type: string ; _dependents: undefined | string[] ; allowedComponents: undefined = undefined; columnClassNames: undefined = undefined; columnCount: undefined = undefined; enabled: undefined | boolean ; gridClassNames: undefined = undefined; id: string ; index: number ; items: any[] ; maxOccur: undefined | number ; minOccur: undefined | number ; parent: undefined = undefined; properties: { [key: string]: any; } ; qualifiedName: any ; readOnly: any ; repeatable: undefined | boolean = true }

Overrides

Scriptable.getState


hasDynamicItems

hasDynamicItems(): boolean

returns whether the items in the Panel can repeat or not

Returns

boolean


importData

importData(dataModel): void

Imports the given form data

Parameters

Name Type
dataModel any

Returns

void

Implementation of

ContainerModel.importData


indexOf

indexOf(f): number

Returns the index of the child item or the child container

Parameters

Name Type
f FieldModel | FieldsetModel

Returns

number

Implementation of

ContainerModel.indexOf


isTransparent

isTransparent(): boolean

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

Returns

boolean

Implementation of

ContainerModel.isTransparent

Inherited from

Scriptable.isTransparent


notifyChildren

notifyChildren(action): void

Parameters

Name Type
action Action

Returns

void


validate

validate(): ValidationError[]

Validates the given form field

Returns

ValidationError[]

Implementation of

ContainerModel.validate

Overrides

Scriptable.validate

Properties

_eventSource

_eventSource: EventSource = EventSource.CODE

Implementation of

ContainerModel._eventSource

Inherited from

Scriptable._eventSource


value

Abstract value: Primitives

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

Implementation of

ContainerModel.value

Inherited from

Scriptable.value

Constructors

constructor

new Container<T>(json, _options)

Type parameters

Name Type
T extends TranslationBaseJson & RulesJson & TranslationConstraintsJson & { accept?: string[] ; enforceEnum?: boolean ; exclusiveMaximum?: number ; exclusiveMinimum?: number ; format?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: number ; pattern?: string ; required?: boolean ; step?: number ; type?: string ; uniqueItems?: boolean ; validationExpression?: string } & { :type?: string ; altText?: string ; appliedCssClassNames?: string ; buttonType?: string ; constraintMessages?: ConstraintsMessages ; dataRef?: null | string ; enabled?: boolean ; errorMessage?: string ; fieldType?: string ; label?: Label ; lang?: string ; name?: string ; properties?: { [key: string]: any; } ; repeatable?: boolean ; screenReaderText?: string ; tooltip?: string ; viewType?: string ; visible?: boolean } & { activeChild?: string ; initialItems?: number ; items: (FieldJson | ContainerJson)[] }

Parameters

Name Type
json T
_options Object
_options.fieldFactory IFormFieldFactory
_options.form FormModel
_options.mode? "create" | "restore"
_options.parent ContainerModel

Overrides

Scriptable<T\>.constructor