ScriptApi
ScriptApi is an exposed JavaScript API for interaction with Form renderer which serves as an alternative solution for cases that can't be solved with dependencies.
The following section describes ScriptApi functions that can be used in code to customize form interactions:
addCodedTextInput
The method addCodedTextInput
adds the input to the form coded text field.
addCodedTextInput(tagOrPath, inputItemValue, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form field. |
inputItemValue | InputItem | true | Specifies the input item in the form { label: string, code: string }. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
addFormElementInput
The addFormElementInput
function enables you to include input items within form components, particularly tailored
for type DV_TEXT and DV_CODEDTEXT.
To include input items in DV_TEXT: Provide a plain text string as the inputItem
.
For DV_CODEDTEXT input items: Supply either an object holding label and code attributes, or an array of such objects.
addFormElementInput(tagOrPath, inputItem, insertIndex, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
inputItemValue | {label: string; code: string} or Array of such objects or string | true | Specifies the input item or items of form element. |
insertIndex | number | false | Specifies index in which to insert the input item. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
addListener
The method addListener
sets up a function that will be called whenever the specified event is delivered to the form element.
addListener(tagOrPath, eventType, callbackFn, optionsParam)
Parameters:
Name | Type | Accepted | Required | Description |
---|---|---|---|---|
tagOrPath | string | - | true | Specifies the path or tag of form element. |
eventType | string | Event types | true | Specifies the event type. |
callbackFn | OnChangeFieldValue | - | - | Specifies the callback function used. |
optionsParam | ScriptApiListenerOptions | - | false | Specifies the optional parameters for listener. |
addListenerForVariable
The method addListenerForVariable
sets up a function that will be called whenever the specified event is triggered on specific variable.
addListenerForVariable(variableName, eventType, callbackFn)
Parameters:
Name | Type | Accepted | Required | Description |
---|---|---|---|---|
variableName | string | - | true | Specifies the name of the variable. |
eventType | string | Event types | true | Specifies the event type. |
callbackFn | OnChangeFieldValue | - | - | Specifies the callback function used. |
optionsParam | ScriptApiListenerOptions | - | false | Specifies the optional parameters for listener. |
Return type: Array<Observable>
addPostSaveHook
The method addPostSaveHook
adds a callback function that executes after saving the composition.
addPostSaveHook(hookName, callbackFn)
Name | Type | Required | Description |
---|---|---|---|
hookName | string | true | Specifies the path or tag of form element. |
callbackFn | function | true | Specifies the callback function used. |
addPreSaveHook
The method addPreSaveHook
sets up a callback that will be called every time before form gets saved or updated.
addPreSaveHook(hookName, callbackFn, hookOptions)
Parameters:
Name | Type | Accepted | Required | Description |
---|---|---|---|---|
hookName | string | - | true | Specifies the name of the callback function. |
callbackFn | Function | - | - | Specifies the callback function used. |
hookOptions | PreSaveHookOptions | - | false | Specifies the options when executing the hook. |
addTag
The method addTag
adds tag to the composition.
addTag(name, value)
Name | Type | Required | Description |
---|---|---|---|
name | string | true | Specifies the name of the tag. |
value | string | true | Specifies the value of the tag. |
callApi
The async method callApi
calls a predefined API using the API name and call name and returning a promise.
callApi(apiName, apiCallName)
Name | Type | Required | Description |
---|---|---|---|
apiName | string | true | Specifies the name of the API. |
apiCallName | string | true | Specifies the API Call name. |
clearFormElement
The method clearFormElement
clears the value of a form element. If the specified element is container, it clears
the values of all its children.
clearFormElement(tagOrPath, options, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
options | ScriptApiClearOptions or string | true | Specifies the optional parameters for method or the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
clearPageValidationErrors
clearPageValidationErrors(pageName)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
pageName | string | true | Specifies the path or tag of form element. |
clearValidationErrors
The method clearValidationErrors
clears validation errors from a form element.
clearValidationErrors(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
clearValue
The method clearValue
clears a specific value in the fields which support selection values.
clearValue(tagOrPath, valueCode, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
valueCode | string | true | Specifies the code of the value you want to clear |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
clearValues
The method clearValues
clears all the values on the form.
clearValues()
clearVariableValue
The method clearVariableValue
clears the value of a specific variable.
clearVariableValue(variableName)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
variableName | string | true | Specifies the name of the variable. |
collapse
The method collapse
collapses the container element.
collapse(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
destroy
The method destroy
destroys all event handlers on the form element.
destroy()
disableFormElement
The method disableFormElement
disables the form element. If the specified element is a container, it also disables all of its children.
disableFormElement(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
disableValue
The method disableValue
disables the input item of form element specified by code value.
disableValue(tagOrPath, valueCode, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
valueCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
duplicateModel
The method duplicateModel
duplicates the model of a form element.
duplicateModel(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: ModelDuplicate
enableFormElement
The method enableFormElement
enables the form element. If the specified element is a container, it also enables all of its children.
enableFormElement(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
enableValue
The method enableValue
enables the input item of form element specified by code value.
enableValue(tagOrPath, valueCode, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
valueCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
executeAql
The method executeAql
executes provided aql.
executeAql(aql, params, force);
Name | Type | Required | Description |
---|---|---|---|
aql | string | true | Specifies the aql to be executed |
params | Map<string, any> | false | Specifies the map of variables in aql. |
force | boolean | false | Specifies if cache should be invalidated |
Return type: Promise
expand
The method expand
expands the container element.
expand(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
extractDataFromApiResponse
The method extractDataFromApiResponse
extracts a value from the API response.
extractDataFromApiResponse(response, keyName)
Name | Type | Required | Description |
---|---|---|---|
response | any | true | Specifies the API response. |
keyName | string | true | Specifies the name of the parameter you want to extract |
Return type: any
formatDate
The method formatDate
formats the date that is passed in
formatDate(date, format)
Parameters:
Name | Type | Accepted | Required | Description |
---|---|---|---|---|
date | Date or number | - | true | Specifies the date that needs to be formatted. |
format | string | Event types | true | Specifies the format. |
Return type: Array<Observable>
getApiRequestPayload
The method getApiRequestPayload
gets the API request payload.
getApiRequestPayload(apiName, apiCallName)
Name | Type | Required | Description |
---|---|---|---|
apiName | string | true | Specifies the name of the API. |
apiCallName | string | true | Specifies the API Call name. |
Return type: unknown
getAqlView
The method getAqlView
gets aql view.
getAqlView(viewName)
Name | Type | Required | Description |
---|---|---|---|
viewName | string | true | Specifies the name of aql view. |
Return type: Promise
getComposition
The method getComposition
gets composition instance.
getComposition()
Return type: object
getFeederAudit
The method getFeederAudit
gets FeederAudit.
getFeederAudit(templateId)
Name | Type | Required | Description |
---|---|---|---|
templateId | string | false | Specifies the template id. |
Return type: FeederAudit
getFieldModel
The method getFieldModel
gets the model instance of a form field.
getFieldModel(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: FormElement
getFieldPosition
The method getFieldPosition
gets the position of a field in the form.
getFieldPosition(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: number
getFieldSearchValue
The method getFieldSearchValue
returns the search value in the input of a coded text field.
getFieldSearchValue(tagOrPath, multiIndex, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Default | Description |
---|---|---|---|---|
tagOrPath | string | true | - | Specifies the path or tag of form field. |
multiIndex | number | false | 0 | Specifies the index number of the value. |
searchWithinContainerTag | string | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | - | Specifies the parent container’s index to search from. |
getFieldValue
The method getFieldValue
gets the value of a form field.
getFieldValue(tagOrPath, multiIndex, searchWithinContainerTag, containerMultiIndex, simpleValue)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
tagOrPath | string | true | - | Specifies the path or tag of form field. |
multiIndex | number | false | 0 | Specifies the index number of the value. |
searchWithinContainerTag | string | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | 0 | Specifies the parent container’s index to search from. |
simpleValue | boolean | false | true | SimpleValue param was added to preserve backwards compatibility, so that CODED_TEXT still returns label as simple value. in new actions this flag is false and suffixes are used to extract the CODED_TEXT value. |
Return type: Object | undefined
getFormInfo
The method getFormInfo
gets information about form.
getFormInfo()
Return type: FormInfo
getImageAreas
The method getImageAreas
returns a defined image map areas on for the Interactive image.
If more than one model is defined for provided formId, function returns an undefined
otherwise it will return an array of ImageArea.
getImageAreas(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
getOrdinalNumberValue
The method getOrdinalNumberValue
gets the selected ordinal number of ordinal field.
getOrdinalNumberValue(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: number | undefined
getScaleNumberValue
The method getScaleNumberValue
gets the selected scale number of scale field.
getScaleNumberValue(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: number | undefined
getSummaries
The method getSummaries
returns an array of objects, where each item is composed with a name, id and an array of tags from that summary.
getSummaries()
Return type: array
getTerminologySelectedValues
The method getTerminologySelectedValues
gets the terminology selected values of a form field.
getTerminologySelectedValues(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: Observable
getValueRef
The method getValueRef
gets model instance.
getValueRef(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: FormElement or array<FormElement>
getVariable
The method getVariable
returns variable name and value.
getVariable(variableName)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
variableName | string | true | Specifies the name of the variable. |
Return type: Variable
goTo
The method goTo
goes to the page specified by the pageId
parameter. If the document is a summary it will go the summary page specified by the pageId.
goTo(pageId)
Name | Type | Required | Description |
---|---|---|---|
pageId | string | true | Specifies the pageId of either a form or a summary page |
goToNext
The method goToNext
goes to the next page of the form. If the document is a summary it will go the next summary page.
goToNext()
goToPrevious
The method goToPrevious
goes to the previous page of the form. If the document is a summary it will go the previous summary page.
goToPrevious()
hideAndClear
The method hideAndClear
hides and clears values from a form element or tag.
hideAndClear(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
hideClearValue
The method hideClearValue
hides and clears the input item at the same time.
hideClearValue(tagOrPath, valueCode, searchWithinContainerTag, containerMultiIndex);
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
valueCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
hideFormElement
The method hideFormElement
hides the form element. If the specified element is a container, it also hides all of its children.
hideFormElement(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
hideValue
The method hideValue
hides the input item.
hideValue(tagOrPath, valueCode, searchWithinContainerTag, containerMultiIndex);
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
valueCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
isElementValid
The method isElementValid
validates form element and returns validation result.
isElementValid(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: boolean
isEmpty
The method isEmpty
returns a boolean value on weather the specified element is empty.
isEmpty(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: boolean
isNotEmpty
The method isNotEmpty
returns a boolean value on weather the specified element is not empty.
isNotEmpty(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
Return type: boolean
isPageValid
The method isPageValid
validates page and returns validation result.
isPageValid(pageId)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
pageId | string | true | Specifies the id of page. |
Return type: boolean
refreshData
The method refreshData
re-fetch data for specific for widget or field with defined datasource.
refreshData(tagOrPath, searchWithinContainerTag)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of widget. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
removeAnnotation
The method removeAnnotation
removes annotation from the model
removeAnnotation(tagOrPath, key, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
key | string | true | Specifies the key of annotation |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
removeCodedTextInput
The method removeCodedTextInput
removes the input item of a form coded text field specified by code value.
removeCodedTextInput(tagOrPath, inputItemCode, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form field. |
inputItemCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
removeFormElementInput
The method removeFormElementInput
removes the input item of a form element specified by code value.
removeFormElementInput(tagOrPath, inputItemCode, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
inputItemCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
removeListener
The method removeListener
removes set up a function that would be called whenever the specified event is delivered to the form element.
removeListener(tagOrPath, eventType)
Parameters:
Name | Type | Accepted | Required | Description |
---|---|---|---|---|
tagOrPath | string | - | true | Specifies the path or tag of form element. |
eventType | string | Event types | true | Specifies the event type. |
removeModel
The method removeModel
removes the model/field from form
removeModel(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form field. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
removePatternValidation
The method setPatternValidation
removes the pattern (regex) validation from a specified field.
removePatternValidation(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
removeValue
The method removeValue
removes specific value from DV_ORDINAL, GENERIC_ORDINAL, DV_CODED_TEXT, GENERIC_CODED_TEXT,
DV_TEXT (with values) or GENERIC_INPUT_TEXT (with values).
removeValue(tagOrPath, inputItemCode, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form field. |
inputItemCode | string | true | Specifies the code of an input item |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
requireFormElement
The method requireFormElement
makes the form element required or optional.
requireFormElement(tagOrPath, value, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
value | boolean | true | Specifies whether the the form element is required or optional. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
resetFormElement
The method resetFormElement
resets the value of a form element to default.
resetFormElement(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
saveComposition
The method saveComposition
saves the composition on the server.
saveComposition(validate, incomplete)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
validate | boolean | false | true | Specifies if form will be validated before saving. |
incomplete | boolean | false | false | Specifies if composition will be saved as incomplete. |
Return type: Promise
scrollToElement
The method scrollToElement
finds the element on the page and scrolls to it. If the element is not found, function completes without doing anything.
Optionally, scrollOptions can be specified to control the scrolling behavior.
scrollToElement(tagOrPath, searchWithinContainerTag, containerMultiIndex, scrollOptions)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
scrollOptions | ScrollIntoViewOptions | false | Specifies scroll behavior |
sendActionToWidget
The method sendActionToWidget
sends the action to widget.
sendActionToWidget(tagOrPath, action, value, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of the widget. |
action | object | true | Specifies the action of the widget. |
value | object | true | Specifies the value you would like to send to the widget. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setAnnotation
The method setAnnotation
set annotation on the model
setAnnotation = (tagOrPath, key, value, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
key | string | true | Specifies the key of annotation |
value | string | true | Specifies the value of annotation |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setApiRequestPayload
The method setApiRequestPayload
sets the API request payload.
setApiRequestPayload(apiName, apiCallName, payload)
Name | Type | Required | Description |
---|---|---|---|
apiName | string | true | Specifies the name of the API. |
apiCallName | string | true | Specifies the API Call name. |
payload | unknown | true | Specifies the payload for the API request. |
Return type: unknown
setCodedTextFieldByLabel
The method setCodedTextFieldByLabel
sets the value of a form coded text field specified by label.
If there are multiple items with the same label, it sets the value of the first one.
setCodedTextFieldByLabel(tagOrPath, value, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
value | string | true | Specifies the label value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setCodedTextInputItems
The setCodedTextInputItems
method serves to replace the existing input items within a coded text field with a new set of input items.
setCodedTextInputItems(tagOrPath, inputItems, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
inputItems | InputItem[] | true | Specifies the input items. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setCodedTextInputs
The setCodedTextInputs
function is designed to append new input items to a coded text field without affecting the existing ones
setCodedTextInputs(tagOrPath, inputItemValues, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form field. |
inputItemValues | array<InputItem> | true | Specifies the array of input items in the form of {label: string, code: string}[]. |
searchWithinContainerTag | string | false | Specifies the parent container's tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setDateField
The method setDateField
sets the value of a form date field.
setDateField(tagOrPath, year, month, day, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
tagOrPath | string | true | - | Specifies the path or tag of form field. |
year | number | true | - | Specifies the year. |
month | number | true | - | Specifies the month. |
day | number | true | - | Specifies the day. |
multiIndex | number | false | 0 | Specifies the index number of the value. |
searchWithinContainerTag | string | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | 0 | Specifies the parent container’s index to search from. |
setDateTimeField
The method setDateTimeField
sets the value of a form date time field.
setDateTimeField(tagOrPath, year, month, day, hour, minute, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
tagOrPath | string | true | - | Specifies the path or tag of form field. |
year | number | true | - | Specifies the year. |
month | number | true | - | Specifies the month. |
day | number | true | - | Specifies the day. |
hour | number | true | - | Specifies the hour. |
minute | number | true | - | Specifies the minute. |
multiIndex | number | false | 0 | Specifies the index number of the value. |
searchWithinContainerTag | string | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | 0 | Specifies the parent container’s index to search from. |
setFeederAudit
The method setFeederAudit
sets FeederAudit parameter and its value.
setFeederAudit(param, value, templateId)
Name | Type | Required | Description |
---|---|---|---|
param | string | true | Specifies the parameter of FeederAudit. |
value | string or number or object or array | true | Specifies the parameter value of the parameter. |
templateId | string | false | Specifies the template id. |
setFieldLabel
The method setFieldLabel
sets the label of a form field.
setFieldLabel(tagOrPath, value, language, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Accepted values | Required | Default | Description |
---|---|---|---|---|---|
tagOrPath | string | - | true | - | Specifies the path or tag of form field. |
value | string or number | - | true | - | Specifies the label of form field. |
language | string | - | true | en | Specifies the localization. |
searchWithinContainerTag | string | - | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | - | false | 0 | Specifies the parent container’s index to search from. |
setFieldValue
The method setFieldValue
sets the value of a form field.
setFieldValue(tagOrPath, value, prop, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Accepted values | Required | Default | Description |
---|---|---|---|---|---|
tagOrPath | string | - | true | - | Specifies the path or tag of form field. |
value | string or number or array<string or number> | - | true | - | Specifies the value or values of form field. |
prop | string | Property names | false | value | Specifies the property name of form field. |
multiIndex | number | - | false | - | Specifies the index number of the value. |
searchWithinContainerTag | string | - | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | - | false | 0 | Specifies the parent container’s index to search from. |
setFormLanguage
The method setFormLanguage
sets the language of form.
setFormLanguage(language)
Name | Type | Required | Description |
---|---|---|---|
language | string | true | Specifies the language of form. |
setFormSubmissionType
The method setFormSubmissionType
sets the submission type of form.
setFormSubmissionType(submissionType)
Name | Type | Required | Description |
---|---|---|---|
submissionType | SubmissionType | true | Specifies the submission type (CREATE or UPDATE) |
setImageAreas
The method setImageAreas
sets the new areas for the Interactive image , provided as an argument to the function. Areas should be the type of
ImageArea or Object
that have all the required attributes declared in ImageArea
. If provided form id does not belong
to field of type DV_CODEDTEXT, function completes without doing anything.
setImageAreas(tagOrPath, areas, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
areas | ImageArea[] or Object[] | true | Specifies the new areas that should be drawn on the image |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setMaxMultiplicity
The method setMaxMultiplicity
sets the max multiplicity value of a form element.
setMaxMultiplicity(tagOrPath, maxMultiplicity, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
maxMultiplicity | number | true | Specifies the value of max multiplicity. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setMinMultiplicity
The method setMinMultiplicity
sets the min multiplicity value of a form element.
setMinMultiplicity(tagOrPath, minMultiplicity, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
minMultiplicity | number | true | Specifies the value of min multiplicity. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setMultiplicity
The method setMultiplicity
serves for setting/rendering right amount of elements on form.
If you want to have exactly 3 elements you could achieve it by setting min and max both to three,
or you simply call api.setMultiplicity('field-id', 3);
. This will ensure that you will see exactly
three fields rendered no matter if there were more or less than three present before calling setMultiplicity.
setMultiplicity(tagOrPath, multiplicity, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
multiplicity | number | true | Specifies the value of min multiplicity. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setOrdinalFieldByLabel
The method setOrdinalFieldByLabel
sets the value of a form ordinal field specified by label.
If there are multiple items with the same label, it sets the value of the first one.
setOrdinalFieldByLabel(tagOrPath, value, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
value | string | true | Specifies the label value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setPatternValidation
The method setPatternValidation
sets a specified field with a custom pattern (regex) validation, and error message.
setPatternValidation(tagOrPath, pattern, errorMessages, searchWithinContainerTag, containerMultiIndex)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
pattern | string | true | Sets the regex pattern. |
errorMessages | string or Record<string, string> | true | Sets the error message, if you have multiple languages you set it in the form of {en: 'Error language en', fr: 'Error language fr} |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setProportionField
The method setProportionField
sets the value of a form proportion field.
setProportionField(tagOrPath, numerator, denominator, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
tagOrPath | string | true | - | Specifies the path or tag of form field. |
numerator | number | true | - | Specifies the numerator value. |
denominator | number | true | - | Specifies the denominator value. |
multiIndex | number | false | 0 | Specifies the index number of the value. |
searchWithinContainerTag | string | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | 0 | Specifies the parent container’s index to search from. |
setScaleFieldByLabel
The method setScaleFieldByLabel
sets the value of a form scale field specified by label.
If there are multiple items with the same label, it sets the value of the first one.
setScaleFieldByLabel(tagOrPath, value, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
value | string | true | Specifies the label value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setTerminologyParameter
The method setTerminologyParameter
sets the terminology of a form field.
setTerminologyParameter(tagOrPath, paramName, paramValue, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form field. |
paramName | string | true | Specifies the parameter name of a terminology. |
paramValue | string | true | Specifies the parameter value of a terminology. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
setTimeField
The method setTimeField
sets the value of a form time field.
setTimeField(tagOrPath, hour, minute, multiIndex, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
tagOrPath | string | true | - | Specifies the path or tag of form field. |
hour | number | true | - | Specifies the hour. |
minute | number | true | - | Specifies the minute. |
multiIndex | number | false | 0 | Specifies the index number of the value. |
searchWithinContainerTag | string | false | - | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | 0 | Specifies the parent container’s index to search from. |
setVariableValue
The method setVariableValue
sets the value of a specific variable.
setVariableValue(variableName, value)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
variableName | string | true | Specifies the name of the variable. |
value | any | true | Specifies the value of the variable. |
setWidgetConfig
The method setWidgetConfig
sets the configuration of the widget.
setWidgetConfig(tagOrPath, config)
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of widget. |
config | object | true | Specifies the configuration of widget. |
showFormElement
The method showFormElement
displays the form element. If the specified element is a container, it also displays all of its children.
showFormElement(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
showValue
The method showValue
shows the input item.
showValue(tagOrPath, valueCode, searchWithinContainerTag, containerMultiIndex);
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
valueCode | string | true | Specifies the input item code value. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
toggleElement
The method toggleElement
toggles between methods hideFormElement and showFormElement for a form element.
toggleElement(tagOrPath, searchWithinContainerTag, containerMultiIndex)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of a form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
updateComposition
The method updateComposition
updates the composition on the server.
updateComposition(validate, incomplete)
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
validate | boolean | false | true | Specifies if form will be validated before updating. |
incomplete | boolean | false | false | Specifies if composition will be updated as incomplete. |
Return type: Promise
validateElement
The method validateElement
validates the element and shows errors if there are any.
validateElement(tagOrPath, searchWithinContainerTag, containerMultiIndex, showErrors)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
tagOrPath | string | true | Specifies the path or tag of form element. |
searchWithinContainerTag | string | false | Specifies the parent container’s tag to search from. |
containerMultiIndex | number | false | Specifies the parent container’s index to search from. Defaults to 0 if searchWithinContainerTag is defined. |
showErrors | boolean | false | Specifies if the validation should show errors on the specified field. |
Return type: boolean
validateForm
The method validateForm
validates the whole form and returns validation result with an errors map inside an object.
validateForm()
Parameters: Function does not accept any arguments
Return type: Object
validatePage
The method validatePage
validates page, returns validation result and shows validation errors on page.
validatePage(pageId)
Parameters:
Name | Type | Required | Description |
---|---|---|---|
pageId | string | true | Specifies the id of page. |
Return type: boolean