Form Script Commands
Sr# | Commands | Return Type | Example | Description | Android | iOS | Web |
1 | getWidgetValue(String identifier) | void | To retrieve widget’s current value using identifier | Yes | Yes | Yes | |
2 | isWidgetVisible(String identifier) | void | To check widget is visible using identifier | Yes | No | Yes | |
3 | getWidgetPrompt(String identifier) | void | To retrieve widgets current visible prompt | Yes | No | Yes | |
4 | getWidgetResourcePrompt(String identifier) | void | To retrieve widgets regex contained prompt | Yes | No | Yes | |
5 | String getCurrentFormId() | String | to get form id. return in string format | Yes | No | Yes | |
6 | String getCurrentFormObjectId() | String | To get current form object id. return in string format | Yes | No | Yes | |
7 | String getFormObjectWidgetValue(String FOID,String identifier) | String | To get value of other form object’s widget value | Yes | No | No | |
8 | setWidgetValue(String identifier, String Value) | “used to set widgets value or updates widgets value reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | Yes | ||
9 | setWidgetPrompt(String identifier, String prompt) | “form script updates widgets prompt reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | Yes | ||
10 | setWidgetVisibility(String identifier, boolean visible) | “set widgets visibility. in form of boolean true or false reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | Yes | ||
11 | setWidgetValidity(String identifier, boolean valid, String message) | Not Implemented | |||||
12 | setWidgetChoices(String identifier, String choicesJSON) | “Used to set source choices of choice widget. It works only on choice, date time, barcode and text widget reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | No | ||
13 | setWidgetValue(String jsonWithIdentifier) | [{“i”:”identifier”,”v”:””},{“i”:”identifier2″,”v”:””}] | “to set bulk values for list of widgets as per below example the setter parameter is in stringify json format reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | No | |
14 | setWidgetPrompt(String jsonWithIdentifier) | [{“i”:”identifier”,”v”:”prompt1″},{“i”:”identifier2″,”v”:”prompt2″}] | “to set bulk prompts for list of widgets as per below example the setter parameter is in stringify json format reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | No | |
15 | setWidgetVisibility(String jsonWithVisibility) | [{“i”:”identifier”,”v”:true},{“i”:”identifier2″,”v”:true}] | “to set bulk visibility for list of widgets as per below example the setter parameter is in stringify json format reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | No | |
16 | applyGeoFence(String identifier) | Not implemented | |||||
17 | setWidgetDisplayMode(String identifier, String displayMode) | displayMode= editable/readonly | “Used to set widget’s display mode either editable or readonly reloadUICell() or reloadUICells should be called after this event to update widgets view.” | Yes | No | No | |
18 | setGeneralWarning(String warningJson) | {“t”:”title”,”m”:”message”} | “During submission process show warning before submission. It add option to submit the form.” | Yes | No | No | |
19 | setGeneralError(String errorJson) | {“t”:”title”,”m”:”message”, “pt”:”regex”} | “After submission if implemented component wants to show error before submission. It don’t allow to submit the form.” | Yes | Yes | No | |
20 | showAlert(String json) | {“t”:”title”,”m”:”message”} | Shows error pop up using provided json data | Yes | No | Yes | |
21 | closeForm(String errorJson) | {“t”:”title”,”m”:”message”} | It shows error like setGeneralError and deletes the form object | Yes | Yes | Yes | |
22 | on_load() | To load the changes onload of form | Yes | Yes | Yes | ||
23 | on_submit() | To put changes on submit of form | Yes | Yes | Yes |
API service
Sr# | Commands | Return Type | Example | Description | Android | iOS | Web |
1 | callAPI(String APIName, String ParameterJSON, String fileJSONArray, String successEvent, String errorEvent) | “Call API to server used to call dynamic API call using implemented component. – have ability to provide parameter in JSON format and files in multipart HTTP call – Output of success or failure will be send on successEvent and errorEvent”. | Yes | No | No | ||
2 | onAPISuccess(String event, String response) | Used to trigger API success event that callAPI event specified with API response. | Yes | No | No | ||
3 | onAPIError(String event, String response) | Used to trigger API error event that callAPI event specified with API response. | Yes | No | No |
Activity/UI Service
Sr# | Commands | Return Type | Example | Description | Android | iOS | Web |
1 | reloadUICell(String identifier) | “used to update view once it is updated by implemented component. The view will not get updated by itself in setWidgetVisibility, setWidgetValue, setWidgetPrompt, setWidgetDisplayMode events” | Yes | No | Yes | ||
2 | reloadUICells(String[] identifier) | “used to update widget views once it is updated by implemented component. The view will not get updated by itself in setWidgetVisibility, setWidgetValue, setWidgetPrompt, setWidgetDisplayMode events” | Yes | No | Yes |
0 Comments