Class: Form
Represents a form that is rendered in Viewer or edited in Builder.
Constructors
constructor
• new Form(componentTree
, localization
, actions
, languages
, defaultLanguage
)
Creates a new instance of Form.
Parameters
Name | Type | Description |
---|---|---|
componentTree | ComponentData | the root component of the form. |
localization | LocalizationStore | the localization of the form. |
actions | ActionValues | the form custom actions. |
languages | Language [] | the localization languages of the form. |
defaultLanguage | Language | the default localization language of the form. |
Properties
actions
• Readonly
actions: ActionValues
The set of action definitions.
componentTree
• Readonly
componentTree: ComponentData
Root component of the form.
defaultLanguage
• defaultLanguage: Language
Default localization language of the form.
errorProps
• errorProps: any
= {}
Properties of the component displaying the error.
errorType
• Optional
errorType: string
The type name of the component displaying the error.
languages
• Readonly
languages: Language
[] = []
Localization languages of the form.
localization
• Readonly
localization: LocalizationStore
Localization of the form.
tooltipType
• Optional
tooltipType: string
The type name of the component displaying the tooltip.
Accessors
actionNames
• get
actionNames(): string
[]
Returns
string
[]
the actions names array.
Methods
cloneAction
▸ cloneAction(namedAction
): void
Clones the action.
Parameters
Name | Type | Description |
---|---|---|
namedAction | NamedActionDefinition | the named action to clone. |
Returns
void
dispose
▸ dispose(): void
Disposes the form. Disposes all the components and localization.
Returns
void
initFields
▸ initFields(): void
Initializes form fields.
Returns
void
removeAction
▸ removeAction(name
): void
Removes the action from the form.
Parameters
Name | Type | Description |
---|---|---|
name | string | the action name to remove. |
Returns
void
updateOrAddAction
▸ updateOrAddAction(oldActionName
, newAction
): void
Changes the existing action to the new one, adds the action if the existing action is not found.
Parameters
Name | Type | Description |
---|---|---|
oldActionName | string | the existing action name. |
newAction | NamedActionDefinition | the new named action. |
Returns
void