Defines form model which implements form model
• get :type(): string
Custom widget type show to the user for capturing the data.
string
Container.:type
• get action(): undefined | string
undefined | string
• get activeChild(): null | BaseModel
null | BaseModel
Container.activeChild
• set activeChild(c): void
| Name | Type |
|---|---|
c |
null | BaseModel |
void
Container.activeChild
• get activeField(): FieldModel
Retrieves the active field in the form.
The active field.
• get captcha(): null | FieldModel
null | FieldModel
• get changeEventBehaviour(): "deps" | "self"
"deps" | "self"
FormModel.changeEventBehaviour
• get dataRef(): undefined | null | string
To map the field’s value to a property in the data model.
undefined | null | string
Container.dataRef
• get description(): undefined | string
Extra description to be shown to the user to aid in form filling experience. It can be rich text.
undefined | string
Container.description
• set description(d): void
Extra description to be shown to the user to aid in form filling experience. It can be rich text.
| Name | Type |
|---|---|
d |
undefined | string |
void
Container.description
• get enabled(): undefined | boolean
Whether the field is enabled and takes part in rules, events etc.
undefined | boolean
Container.enabled
• set enabled(e): void
Whether the field is enabled and takes part in rules, events etc.
| Name | Type |
|---|---|
e |
undefined | boolean |
void
Container.enabled
• get fieldType(): string
Type of field to capture the user data.
string
Container.fieldType
• get form(): FormModel
Container.form
• get fragment(): string
string
Container.fragment
• get id(): string
Id of the form.
string
Container.id
• get index(): number
The index of the Field within its parent.
number
Container.index
• get isContainer(): boolean
Whether the form field is container or not
boolean
Container.isContainer
• get isFragment(): boolean
boolean
Container.isFragment
• get items(): (FieldModel | FieldsetModel)[]
Defines the children/items of the container
(FieldModel | FieldsetModel)[]
Container.items
• get label(): undefined | Label
Label to be used for the field.
undefined | Label
Container.label
• set label(l): void
Label to be used for the field.
| Name | Type |
|---|---|
l |
undefined | Label |
void
Container.label
• get lang(): undefined | string
language of the field
undefined | string
Container.lang
• get logger(): Logger
Logger
• get maxItems(): number
number
Container.maxItems
• set maxItems(m): void
| Name | Type |
|---|---|
m |
number |
void
Container.maxItems
• get metaData(): FormMetaData
• get minItems(): number
number
Container.minItems
• set minItems(m): void
| Name | Type |
|---|---|
m |
number |
void
Container.minItems
• get name(): string
Name of the form field.
string
Container.name
• get parent(): ContainerModel
Defines the parent of the container
Container.parent
• get properties(): Object
Custom properties of the form field.
Object
Container.properties
• set properties(p): void
Custom properties of the form field.
| Name | Type |
|---|---|
p |
Object |
void
Container.properties
• get qualifiedName(): string
string
Container.qualifiedName
• get readOnly(): any
Whether the field should be readOnly to end user or not.
any
Container.readOnly
• set readOnly(e): void
Whether the field should be readOnly to end user or not.
| Name | Type |
|---|---|
e |
any |
void
Container.readOnly
• get repeatable(): any
Field is repeatable or not
any
Container.repeatable
• get ruleEngine(): RuleEngine
RuleEngine
FormModel.ruleEngine
Container.ruleEngine
• get screenReaderText(): undefined | string
undefined | string
Container.screenReaderText
• get specVersion(): Version
Version
• get title(): string
Form title.
string
• get type(): string
string
Container.type
• get uniqueItems(): undefined | boolean
undefined | boolean
Container.uniqueItems
• get value(): null
The current value of the Field. The property is serialized in the Data Model.
null
Container.value
• get visible(): undefined | boolean
Whether the field should be visible to author or not.
undefined | boolean
Container.visible
• set visible(v): void
Whether the field should be visible to author or not.
| Name | Type |
|---|---|
v |
undefined | boolean |
void
Container.visible
▸ _canHaveRepeatingChildren(mode?): boolean
| Name | Type | Default value |
|---|---|---|
mode |
FormCreationMode |
'create' |
boolean
Container._canHaveRepeatingChildren
▸ _findActiveField(field): any
| Name | Type |
|---|---|
field |
null | FieldModel | FieldsetModel |
any
▸ addPromises(updates): void
| Name | Type |
|---|---|
updates |
Promise<any> |
void
FormModel.addPromises
▸ change(event, context): void
| Name | Type |
|---|---|
event |
Action |
context |
any |
void
▸ clearIdRegistry(): void
Clears the ID registry to prevent ID conflicts This is useful when recreating forms or during testing
void
▸ executeAction(action): void
Executes the given action
| Name | Type | Description |
|---|---|---|
action |
Action |
event object |
void
▸ executeExpression(expr): any
| Name | Type |
|---|---|
expr |
string |
any
▸ exportData(attachmentSerializedMap?): any
Exports the form data
| Name | Type |
|---|---|
attachmentSerializedMap |
Object |
any
▸ exportSubmitMetaData(): SubmitMetaData
Retrieve submit meta data of form.
function exportSubmitMetaData
property {string} lang - The language of the form.
property {Object} captchaInfo - The information about the CAPTCHA.
▸ focus(): void
void
▸ getDependents(): { id: string = x.node.id; propertyName: undefined | string = x.propertyName }[]
{ id: string = x.node.id; propertyName: undefined | string = x.propertyName }[]
▸ getElement(id): FieldModel | FieldsetModel | Form
Get form element model based on the id of the form element
| Name | Type |
|---|---|
id |
string |
FieldModel | FieldsetModel | Form
▸ getNonTransparentParent(): ContainerModel
Container.getNonTransparentParent
▸ getPropertiesManager(): PropertiesManager
Get the PropertiesManager instance for use in setVariable
PropertiesManager
Container.getPropertiesManager
▸ getRules(): Items<string>
Items<string>
▸ getState(forRestore?): TranslationBaseJson & RulesJson & TranslationConstraintsJson & { accept?: string[] ; enforceEnum?: boolean ; exclusiveMaximum?: string | number ; exclusiveMinimum?: string | number ; format?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: string | number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: string | 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)[] } & { action?: string ; adaptiveform?: string ; data?: any ; lang?: string ; metadata?: MetaDataJson ; title?: string } & { :items: undefined = undefined; :itemsOrder: undefined = undefined; :type: string ; _dependents: undefined | { id: string = x.node.id; propertyName: undefined | string = x.propertyName }[] ; _itemTemplate: undefined | { :type?: string ; accept?: string[] ; altText?: string ; appliedCssClassNames?: string ; buttonType?: string ; checked?: boolean ; constraintMessages?: ConstraintsMessages ; dataRef?: null | string ; default?: any ; description?: string ; displayFormat?: string ; displayValue?: string ; displayValueExpression?: string ; editFormat?: string ; editValue?: string ; emptyValue?: "" | "undefined" | "null" ; enabled?: boolean ; enforceEnum?: boolean ; enum?: any[] ; enumNames?: string[] ; errorMessage?: string ; events?: Items<undefined | string | string[]> ; exclusiveMaximum?: string | number ; exclusiveMinimum?: string | number ; fieldType?: string ; format?: string ; label?: Label ; lang?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: string | number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: string | number ; name?: string ; pattern?: string ; placeholder?: string ; properties?: { [key: string]: any; } ; readOnly?: 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 } | { :type?: string ; accept?: string[] ; activeChild?: string ; altText?: string ; appliedCssClassNames?: string ; buttonType?: string ; constraintMessages?: ConstraintsMessages ; dataRef?: null | string ; description?: string ; enabled?: boolean ; enforceEnum?: boolean ; enum?: any[] ; enumNames?: string[] ; errorMessage?: string ; events?: Items<undefined | string | string[]> ; exclusiveMaximum?: string | number ; exclusiveMinimum?: string | number ; fieldType?: string ; format?: string ; initialItems?: number ; items: (FieldJson | ContainerJson)[] ; label?: Label ; lang?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: string | number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: string | number ; name?: string ; pattern?: string ; properties?: { [key: string]: any; } ; readOnly?: boolean ; repeatable?: boolean ; required?: boolean ; rules?: Items<string> ; screenReaderText?: string ; step?: number ; tooltip?: string ; type?: "object" | "array" ; uniqueItems?: boolean ; validationExpression?: string ; viewType?: string ; visible?: boolean } ; 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 state of the form
To access the form data and attachments, one needs to use the data and attachments property.
For example,
const data = form.getState().data
const attachments = form.getState().attachments
| Name | Type | Default value |
|---|---|---|
forRestore |
boolean |
false |
TranslationBaseJson & RulesJson & TranslationConstraintsJson & { accept?: string[] ; enforceEnum?: boolean ; exclusiveMaximum?: string | number ; exclusiveMinimum?: string | number ; format?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: string | number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: string | 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)[] } & { action?: string ; adaptiveform?: string ; data?: any ; lang?: string ; metadata?: MetaDataJson ; title?: string } & { :items: undefined = undefined; :itemsOrder: undefined = undefined; :type: string ; _dependents: undefined | { id: string = x.node.id; propertyName: undefined | string = x.propertyName }[] ; _itemTemplate: undefined | { :type?: string ; accept?: string[] ; altText?: string ; appliedCssClassNames?: string ; buttonType?: string ; checked?: boolean ; constraintMessages?: ConstraintsMessages ; dataRef?: null | string ; default?: any ; description?: string ; displayFormat?: string ; displayValue?: string ; displayValueExpression?: string ; editFormat?: string ; editValue?: string ; emptyValue?: "" | "undefined" | "null" ; enabled?: boolean ; enforceEnum?: boolean ; enum?: any[] ; enumNames?: string[] ; errorMessage?: string ; events?: Items<undefined | string | string[]> ; exclusiveMaximum?: string | number ; exclusiveMinimum?: string | number ; fieldType?: string ; format?: string ; label?: Label ; lang?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: string | number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: string | number ; name?: string ; pattern?: string ; placeholder?: string ; properties?: { [key: string]: any; } ; readOnly?: 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 } | { :type?: string ; accept?: string[] ; activeChild?: string ; altText?: string ; appliedCssClassNames?: string ; buttonType?: string ; constraintMessages?: ConstraintsMessages ; dataRef?: null | string ; description?: string ; enabled?: boolean ; enforceEnum?: boolean ; enum?: any[] ; enumNames?: string[] ; errorMessage?: string ; events?: Items<undefined | string | string[]> ; exclusiveMaximum?: string | number ; exclusiveMinimum?: string | number ; fieldType?: string ; format?: string ; initialItems?: number ; items: (FieldJson | ContainerJson)[] ; label?: Label ; lang?: string ; maxFileSize?: string | number ; maxItems?: number ; maxLength?: number ; maxOccur?: number ; maximum?: string | number ; minItems?: number ; minLength?: number ; minOccur?: number ; minimum?: string | number ; name?: string ; pattern?: string ; properties?: { [key: string]: any; } ; readOnly?: boolean ; repeatable?: boolean ; required?: boolean ; rules?: Items<string> ; screenReaderText?: string ; step?: number ; tooltip?: string ; type?: "object" | "array" ; uniqueItems?: boolean ; validationExpression?: string ; viewType?: string ; visible?: boolean } ; 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 }
▸ getUniqueId(id?): string
| Name | Type |
|---|---|
id? |
string |
string
FormModel.getUniqueId
▸ hasDynamicItems(): boolean
returns whether the items in the Panel can repeat or not
boolean
▸ importData(dataModel): void
Imports the given form data
| Name | Type |
|---|---|
dataModel |
any |
void
▸ indexOf(f): number
Returns the index of the child item or the child container
| Name | Type |
|---|---|
f |
FieldModel | FieldsetModel |
number
▸ isTransparent(): boolean
Transparent form fields are meant only for creation of view. They are also not part of data
boolean
▸ isValid(): boolean
Checks if the given form is valid or not
boolean
true, if form is valid, false otherwise
▸ notifyChildren(action): void
| Name | Type |
|---|---|
action |
Action |
void
▸ resolveQualifiedName(qualifiedName): null | FieldModel | FieldsetModel
Resolves a form element by its qualified name.
see FieldModel
see FieldsetModel
| Name | Type | Description |
|---|---|---|
qualifiedName |
string |
The qualified name to resolve. |
null | FieldModel | FieldsetModel
The resolved form element, or null if not found.
FormModel.resolveQualifiedName
▸ setAdditionalSubmitMetadata(metadata): void
| Name | Type |
|---|---|
metadata |
Record<string, any> |
void
▸ setFocus(field, focusOption): void
This function sets the focus to the field passed The field can be a panel or a form field. If a focusOption is specified along with a panel the navigation is restricted to that panel. If a focusOption is specified along with a field as input the navigation happens in the parent panel of that field.
| Name | Type | Description |
|---|---|---|
field |
BaseModel |
can be a panel or a field. |
focusOption |
FocusOption |
should be an enum of type FocusOption |
void
▸ validate(): ValidationError[]
Validates the given form field
▸ visit(callBack): void
visits each element in the form
| Name | Type | Description |
|---|---|---|
callBack |
(field: FieldModel | FieldsetModel) => void |
a function which is invoked on each form element (including container type elements) visited |
void
▸ waitForPromises(): Promise<void>
Promise<void>
FormModel.waitForPromises
• _eventSource: EventSource = EventSource.CODE