6.5.2 Action scripts (UI Version 1.1)
The script specified by the “file” label in the Script YAML file must be created in advance. Please write the script in JavaScript. The following is a list of action execution timings for each component and the names of functions that are called. The customer should define the function name in the corresponding script and write the contents of the action.
(Table) List of execution timings for each component and function names (UI Version 1.1)
| Component | Action execution timing |
Name of function called in the script |
Function arguments | ||
|---|---|---|---|---|---|
| Data format | Variable name | Value to be set | |||
| Grid | When the window is displayed | handleLoad | - | - | - |
| Button | When the button is clicked | handleClick*1 | string | name | Name of the clicked button |
| Immediately after the button is clicked | handleBeforeAction*2 | - | - | - | |
| Before saving data | handleBeforeSave*2 | - | - | - | |
| After saving data | handleAfterSave*2 | - | - | - | |
| Before proceeding to the next step in the workflow | handleBeforeRequestWorkflow*2 | - | - | - | |
| handleBeforeResumeStep*2 | - | - | - | ||
| Form | When the window is displayed | handleLoad | - | - | - |
| When obtaining the initial field of a Form | handleAfterLoadData | - | - | - | |
| When changing a field in a Form | handleChange | string | fieldName | Name of the changed field | |
| any | fieldValue | Value of the changed field | |||
| Object | fieldExtension | Value of the changed field | |||
| boolean | fieldExtension.checked | Checkbox check state (when properties.checkbox: true) | |||
| string | fieldExtension.operator | Operator (when properties.operator: true) | |||
| any | fieldExtension.firstOperand | First operand (when properties.operator: true, none depending on the operator) | |||
| any | fieldExtension.secondOperand | Second operand (when properties.operator: true, none depending on the operator) | |||
| When focus is lost | handleBlur | string | fieldName | Name of the changed field | |
| any | fieldValue | Value of the changed field | |||
| Object | fieldExtension | Value of the changed field | |||
| boolean | fieldExtension.checked | Checkbox check state (when properties.checkbox: true) | |||
| string | fieldExtension.operator | Operator (when properties.operator: true) | |||
| any | fieldExtension.firstOperand | First operand (when properties.operator: true, none depending on the operator) | |||
| any | fieldExtension.secondOperand | Second operand (when properties.operator: true, none depending on the operator) | |||
| Table | Change Table row selection | handleSelectionModelChange | GridRowId[] or GridRowId | selectModel | When the properties.selection: of the Table component is "checkbox", it is an array of the IDs of the selected rows, and when it is "radio", it is the ID of the selected row |
| When clicking on a cell | handleCellClick | string | field | Column name of the clicked column | |
| object | row | Row data for the clicked row | |||
| When the cell value changes | handleCellValueChange | any | value | Entered value | |
| When clicking on the cell icon | handleIconClick | Object | row | Row data for the clicked row | |
| Tabs | When the tab selection changes | handleChange | string | name | Name of the selected tab |
| object | activeTab | Information on the selected tab | |||
| When tab is active | handleActivate | string | name | Name of the tab that has become active | |
| object | activeTab | Information on the tab that has become active | |||
| When tab is inactive | handleDeactivate | string | name | Name of the tab that has become inactive | |
| object | activeTab | Information on the tab that has become inactive | |||
| When clicking the Add Tab button | handleAddButtonClick | Array.<object> | - | List of information on displayed tabs | |
| Card | When the Card is clicked | handleClick*3 | string | name | Name of the clicked card |
| When the window is displayed | handleLoad | - | - | - | |
| Label | When the window is displayed | handleLoad | - | - | - |
The following is a list of class names and function names that can be used when describing the contents of an action.
Classes that can be used without creating an instance:
- OIWindow
- OIData
- OIWorkflow
- OIApi
- OICommon
- OIUi
Classes that are used by creating an instance:
- OIActionButton (internal name of the Action Button)
- OIButton (internal name of the Button component)
- OITableDataSource (user-defined name of the Data Source)
- OIForm (internal name of the Form component)
- OITable (internal name of the Table component)
- OITabs (internal name of the Tabs component)
- OITab (internal name of the Tab component)
- OIArticle (internal name of the Article component)
- OIAttachment (internal name of the Attachment component)
- OICard (internal name of the Card component)
- OIPaper (internal name of the Paper component)
- OILabel (internal name of the Label component)
- OIStore (options)
The internal name of an action button is the value set in the buttons name, the internal name of a component is the value set in the components name, and the user-defined name of a data source is the value set in the dataSource.tables name. For details on internal names and user-defined names, see "(Table) UI definitions (UI version 1.1)".
OIStore is used when saving data in the browser. Saved data is not deleted when closing the browser tab or window, but it is deleted if the browser's site data or cache is cleared.
The argument "options" of OIStore has the following two properties.
- namespace: Specify the namespace (string type) in which to save the data.
Data can be managed for each namespace. If the key is duplicated within the same namespace, the data is overwritten. If the key is duplicated in different namespaces, the data is saved as different data. If nothing is specified, the data is saved in the default namespace. - scope: Specify either "all" or "user" as the users who can access the data.
- all: All users can access the data.
- user: Only the data specific to the logged-in user can be accessed. Data saved with "all" cannot be accessed.
(Table) List of function names that can be used when describing the contents of an action (UI version 1.1)
| Class name | Function name | Function arguments | Content of action | |||
|---|---|---|---|---|---|---|
| Data format | Variable name | Value to be set | ||||
| OIWindow | open | string | - | type | Specify "move", "new_window", or "new_tab".
|
Open a page or UI. |
| Object | options | - | ||||
| string | url | Specify the URL of the page to be displayed in "url". Example) {url:'/sys_task'} |
||||
| OIWindow | showMessage | string | - | type | Specify "snackbar" to display messages in a snackbar, or "modal" to display messages in a dialog box. | Display a snackbar or message dialog box. If "modal" is specified for type, when the first button is clicked, "ok" is set as the return value, and when the last button is clicked, "cancel" is set as the return value in Promise<string> type. |
| Object | options | - | ||||
| string | typeMess | If the type is "snackbar", specify "error", "warning", "info", or "success". If the type is "modal", any number of buttons can be displayed, and it is possible to determine which button was clicked by receiving the return value. | ||||
| string | content | Specify the message that is displayed. | ||||
| string | title | If the type is "modal", specify a title. | ||||
| [Array<Object>] | buttons | If the type is "modal", set the button label and value (returned when clicked) as follows.
- [Array<Object>] buttons - {string} name - {string} value |
||||
| Object | btnOk | If the type is "modal", set the content to be displayed in the label of the first button. | ||||
| string | btnCancel | If the type is "modal", set the content to be displayed in the label of the last button. If both btnOk and btnCancel are omitted, the "OK" button will be displayed. |
||||
| string | subContent | If the type is "modal", set an additional message to be displayed below the content message. Can be omitted. | ||||
| boolean | useConfirm | If the type is "modal" and "true" is specified, a confirmation checkbox is added for clicking the "OK" button. If omitted, it becomes "false". | ||||
| OIWindow | resetScroll | - | - | - | - | Reset the scroll position of the content area. |
| OIWindow | openDialog | string | - | ui | Specify the UI manifest to display in the content area of the dialog box. | Open the dialog box. Wait until the dialog box is closed by closeDialog. When the Promise is resolved, the value passed as Promise<any> is returned to the result of closeDialog. |
| Object | options | Specify options for the dialog box. | ||||
| string | title | Specify the YAML file of the UI to display in the content of the dialog box. This is optional. | ||||
| string | titleIcon | Specify the icon to display at the beginning of the dialog box title. Use icons provided by Material UI. For details, see https://v5.mui.com/material-ui/material-icons/. This is optional. |
||||
| object | dialogSx | Specify the style for the entire outer frame of the dialog box based on the sx property of Material UI. For details, see https://v5.mui.com/system/getting-started/the-sx-prop/. This is optional. | ||||
| object | contentSx | Specify the style for the content of the dialog box based on the sx property of Material UI. For details, see https://v5.mui.com/system/getting-started/the-sx-prop/. This is optional. | ||||
| OIWindow | closeDialog | any | - | result | Specify the value to be returned as the return value of openDialog. | Close the dialog box. Return a Promise<undefined> that waits until completion. |
| OIData | insertCurrentRecord | Object | currentRecord | - | Insert records into any table in the database using Ops I REST API graphql. Set the Response Body as a Promise<Object> type in the return value. | |
| string | table | Specify the table name into which the record will be inserted. | ||||
| Object | Field name of the inserted record | Specify the value to be set in the field of the inserted record. Any number can be specified, but it must correspond to the field name of the table where it is to be inserted. The value to be set should match the field type; for example, "string" for a string field, or "number" for a numeric field. | ||||
| string | - | ctxId | Specify the context ID to be associated with the record to be inserted. | |||
| OIData | getRecords | string | - | tableName | Specify the table name of the record to be obtained. | Uses the Ops I REST API graphql to obtain records from any table in the database, and set the Response Body as a Promise<Object> type in the return value. |
| string | - | obj | Specify the GraphQL query for the record obtain condition. Example 1) When specifying the fields to be obtained: '{field1 field2}' Example 2) When obtaining field1 and field2 for the same record as the specified record ID: '( where: { id: {_eq: "record ID" } }){field1 field2}' |
|||
| OIData | updateCurrentRecord | Object | currentRecord | - | Uses the Ops I REST API graphql to update any record in a table in the database, and sets the Response Body as a Promise<Object> type in the return value. | |
| string | table | Required. Specify the table name of the record to be updated. | ||||
| string | id | Required. Specify the ID of the record to be updated. | ||||
| Object | Field name of the updated record | Specify the value to be set in the field of the record to be updated. Any number can be specified, but it must correspond to the field name of the table where it is to be updated. The value to be set should match the field type; for example, "string" for a string field, or "number" for a numeric field. | ||||
| OIData | deleteCurrentRecord | string | - | tableName | Specify the table name of the record to be deleted. | Uses the Ops I REST API graphql to delete any record from a table in the database, and sets the Response Body as a Promise<Object> type in the return value. |
| string | - | currentId | Specify the ID of the record to be deleted. | |||
| OIData | query | Object | query | - | Use the Ops I REST API graphql to execute any GraphQL query and set the Response Body as a Promise<Object> type in the return value. | |
| string | query | Specify the GraphQL query to be executed as a string. | ||||
| Object | variables | Specify variables to be embedded in the GraphQL query. | ||||
| OIWorkflow | respond | string | - | contextID | Context ID | Responds to the workflow and sets the execution result as the return value of the Promise<Object> type. |
| string | - | activityName | Reply activityName (Task name specified in tasks in the workflow definition) | |||
| Object | - | params | Specifies one of the following as the action to be taken in response: "accept", "reject", "pull_back", or "cancel". Example) { "oi_response": "accept" } |
|||
| OIWorkflow | start | string | - | contextID | Context ID | Executes the workflow associated with the specified context ID and sets the execution result as the return value of the Promise<Object> type. |
| Object | - | body | Specifies the contents of the parameters to be set in the workflow. Example) { "params": { "param1": "string", "param2": "string", "param3": "string" } } |
|||
| OIWorkflow | save | boolean | - | options | Specify the following.
|
Save the workflow. Return a Promise that waits until the save process of the specified data source is complete. If an error occurs during saving, an error message is displayed. |
| OIWorkflow | getActivity | - | - | - | - | Obtains the object (StackStorm step object) of the activity in the currently displayed workflow as a Promise<Object> type. Returns a Promise that waits until it is obtained. |
| OIApi | call | string | - | url | Specify the URL of the REST API to be executed. The REST API you specify must have a Response Body in JSON format. | Execute the REST API and set the Response Body as a Promise<Object> type in the return value. |
| Object | - | option | Specify the parameters. If omitted, {} is set. Example) {method: 'GET', headers: {'Content-Type': 'application/json'}} |
|||
| boolean | - | showError | Specify whether to display error details on the window when an error occurs in REST API. If omitted, will be set to "true". | |||
| OICommon | getUserProfile | - | - | - | - | Obtains the profile of the logged-in user and sets it as a Promise<UserPrincipalDTO> type in the return value. UserPrincipalDTO contains the following information.
|
| OICommon | getUserTimezone | - | - | - | - | Acquires the time zone of the logged-in user and set it as the return value in string type. Example: UTC+09:00 |
| OICommon | getDateWithUserTimezone | - | - | - | - | Obtains the current date and time (YYYY-MM-DDTHH:mm:ssZ) in the time zone of the logged-in user and sets it as a string in the return value. Example) 2022-09-21T15:36:20+09:00 |
| OICommon | formatWithUserTimeZone | string | - | val | Date Example: 2022-09-21T06:36:20 |
Displays the specified date in the logged-in user's time zone and sets it as the return value in string type. Example: changed date 2022-09-21T15:36:20+09:00 |
| format | Format Example: YYYY-MM-DDTHH:mm:ssZ |
|||||
| OICommon | getUTCOffset | - | - | - | - | Acquires the browser's time zone and sets it as the return value in string type. Example: UTC+09:00 |
| OICommon | translate | Object | - | dictionary | Define character strings for each language. | Returns a string matching the user's language settings. |
| string | - | key | Specify the key to be obtained from the dictionary. | |||
| OICommon | showLoadingScreen | - | - | - | - | Displays the lock window. The counter is incremented by the number of executions. |
| OICommon | hideLoadingScreen | - | - | - | - | Removes the lock window display. The counter is decremented by the number of executions, and the display is removed when the counter reaches 0. To avoid the window becoming unresponsive and staying on the lock window, use a try-finally clause, etc., to set it so that hideLoadingScreen is always called even in the event of an error. If the lock window is not displayed when this method is called, this method will have no effect on the window and it will close normally. |
| OICommon | copyClipboard | string | - | data | Specify a string to paste to the clipboard. | Pastes the specified string to the clipboard. |
| OICommon | getLocation | - | - | - | - | Obtains current position information for the current document using Window.location (Web API built into the browser), and sets the return value as the following Promise<Object> type.
|
| OIStore | get | string | - | key | Specify a key. | The value corresponding to the key is acquired with Promise<any>. If no value is set, Promise<undefined> is returned. If the key is not of type string, a TypeError occurs. |
| OIStore | set | string | - | key | Specify a key. | Set the value corresponding to the key. A Promise<undefined> that waits until the setting is complete is returned. If a value is already set, it is overwritten. If the key is not of type string, a TypeError occurs. |
| any | - | value | Specify the value to be set. | |||
| OIStore | delete | string | - | key | Specify a key. | The value corresponding to the key is deleted. If no value is set, nothing happens. If the value is deleted, "true" is returned, and if it is not deleted, "false" is returned, in Promise<boolean> type. A Promise that waits until deletion is complete is returned. If the key is not of type string, a TypeError occurs. |
| OIStore | has | string | - | key | Specify a key. | Retrieves whether a value exists for the key. If a value is set, "true" is returned, and if it is not set, "false" is returned, in Promise<boolean> type. A Promise that waits until retrieving whether a value exists for the key is complete is returned. If the key is not of type string, a TypeError occurs. |
| OIUi | getContext | - | - | - | - | Obtains context information and sets the following as a Promise<Object> type in the return value.
|
| OIUi | getName | - | - | - | - | Retrieves the UI name. When the Promise is resolved, the UI name is returned as Promise<string>. |
| OIActionButton | setVisible | boolean | - | isVisible | Specify "true" (show) or "false" (hide). | Sets whether to show or hide buttons. Returns a Promise<undefined> that waits until the setting is complete. |
| OIActionButton | setEnable | boolean | - | isEnable | Specify "true" (active) or "false" (inactive). | Sets whether a button is active or inactive. Returns a Promise<undefined> that waits until the setting is complete. |
| OIButton | setVisible | string | - | buttonName | Name of the target button in the button list | Sets whether to show or hide buttons. Returns a Promise<undefined> that waits until the setting is complete. |
| boolean | - | isVisible | Specify "true" (show) or "false" (hide). | |||
| OIButton | setEnable | string | - | buttonName | Name of the target button in the button list | Sets whether a button is active or inactive. Returns a Promise<undefined> that waits until the setting is complete. |
| boolean | - | isEnable | Specify "true" (active) or "false" (inactive). | |||
| OITableDataSource | refresh | boolean | - | loading | Whether loading icons are displayed (when omitted: not displayed) | The data is obtained again and the obtained data is reflected in the places where the data source is used. Returns a Promise<undefined> that waits until complete. |
| OITableDataSource | setAutorefreshSeconds | number | - | secondsValue | Specify the automatic refresh interval (seconds) as an integer. | Sets the automatic refresh interval. Returns a Promise<undefined> that waits until complete. |
| OITableDataSource | getParameter | string | - | paramName | Specify the parameter name for the specified data source name. | Obtains the parameter settings for the specified data source name as a Promise<TableDataSourceParameter> type or Promise<undefined>. If it does not match the specified paramName, Promise<undefined> is returned. |
| OITableDataSource | setParameter | string | - | paramName | Specify the parameter name for the specified data source name. | Sets the parameter for the specified data source name (overwrites if the specified parameter exists, creates if it does not). Returns a Promise<undefined> that waits until complete. |
| TableDataSourceParameter | - | parameter | Specify the parameter object to be updated. Example: { type: ' fixed' , value: ' true' , } Specify the type as "fixed", "query", or "uipath", and the value as a string. Null and undefined can also be specified. |
|||
| OITableDataSource | deleteParameter | string | - | paramName | Specify the parameter name for the specified data source name. | Deletes the parameter configuration for the specified data source name. Returns a Promise<undefined> that waits until complete. |
| OITableDataSource | update | boolean | - | options | Specify the following.
|
Updates the resource referenced by the Table data source. Returns a Promise that waits until complete. |
| OITableDataSource | create | Creates the resource referenced by the Table data source. Returns a Promise that waits until complete. | ||||
| OITableDataSource | delete | Deletes the resource referenced by the Table data source. Returns a Promise that waits until complete. | ||||
| OIForm | setStatus | string | - | field | Specify the target field name for which the status is to be set. | Set the status of the field in the form. Only field types with a function to output validation errors are supported. Returns a Promise<undefined> that waits until the value of the argument status is reflected in the target field. |
| string | - | status | Set the status. Setting "error" will result in an error state, and setting anything else will cancel the error state. | |||
| OIForm | setHelperText | string | - | field | Specify the target field name for which the helper text is to be set. | Set the helper text for the form field. Only field types with a function to output validation error messages are supported. Returns a Promise<undefined> that waits until the value of the argument helperText is reflected in the target field. |
| string | - | helperText | Set the helper text. | |||
| OIForm | removeHelperText | string | - | field | Specify the field name for which the helper text is to be deleted. | Delete the helper text for the form field. Only field types with a function to output validation error messages are supported. Returns a Promise<undefined> that waits until the value of the argument helperText is deleted from the target field. |
| OIForm | getFieldValue | string | - | fieldName | Specify the field name. | Obtains the field value is returned as Promise<object> type. |
| OIForm | getFieldValues | - | - | - | - | All field values are returned as Promise<object> type. |
| OIForm | getFieldExtension | string | - | fieldName | Specify the field name. | Obtains various field information is returned as Promise<object> type. |
| OIForm | getFieldExtensions | - | - | - | - | All field information is returned as Promise<object> type. |
| OIForm | setFieldValue | string | - | fieldName | Specify the field name. | Sets the field values. Returns a Promise<undefined> that waits until the value of the argument fieldValue is reflected in the target field. |
| any | - | fieldValue | Specify the field value. | |||
| OIForm | setFieldExtensions | string | - | fieldName | Specify the field name. | Sets various field information. Returns a Promise<undefined> that waits until the value of the argument extensions is reflected in the target field. |
| object | - | extensions | Specify various field information. | |||
| OIForm | setFieldVisible | string | - | fieldName | Specify the field name. | Sets whether to show or hide a field. Returns a Promise<undefined> that waits until the setting is complete. |
| boolean | - | visibility | Specify whether to show or hide a field. | |||
| OIForm | validate | - | - | - | - | Returns the Form validation result as a Promise<boolean> type.
|
| OIForm | setLookupLabelQuery | string | - | fieldName | Specify the target field name. | Sets the labelQuery for the target lookup field. Returns a Promise<undefined> that waits until the setting is complete. |
| string | - | value | Specify the labelQuery for the lookup field. | |||
| OIForm | getLookupLabelQuery | string | - | fieldName | Specify the target field name. | Obtains the labelQuery for the target field. If the target field is not a lookup field, or if the labelQuery property is omitted, a Promise<undefined> is returned. |
| OIForm | setEnable | boolean | - | isEnable | Specify "true" (active) or "false" (inactive). | Sets whether the target form is active or inactive. Returns a Promise<undefined> that waits until the setting is complete. |
| OIForm | setFieldEnable | string | - | fieldName | Specify the target field name. | Sets whether the target field is active or inactive. Returns a Promise<undefined> that waits until the setting is complete. |
| boolean | - | isEnable | Specify "true" (active) or "false" (inactive). | |||
| OIForm | getEnumValues | string | - | fieldName | Specify the name of the target field. | Retrieves the options set for a field of type Enum. The options held by the Enum-type field are returned as Promise<EnumValue[]>. Type EnumValue: string | { name: string, label?: string } If the field is not of type Enum, a Promise<undefined> is returned. |
| OIForm | setEnumValues | string | - | fieldName | Specify the name of the target field. | A Promise<undefined> that waits until options are set for the target Enum field is returned. Type EnumValue: string | { name: string, label?: string } If the field is not of type Enum, nothing is set. |
| EnumValue[] | - | values | Set any options for an Enum-type field. | |||
| OITable | setRows | object[] | - | rows | Specify the row data. | A Promise<undefined> that waits until the setting is complete is returned. |
| OITable | addRows | object[] | - | rows | Specify the row data to be appended at the end. | A Promise<undefined> that waits until the addition is complete is returned. |
| OITable | deleteRows | string[]|number[] | - | rowIds | Specify an array of IDs of the rows to be deleted. | The deleted row data is returned as an array of type Promise<object[]>. If one row is deleted, an array with one element is returned. If zero rows are deleted, an empty array is returned. |
| OITable | getRows | - | - | - | - | Retrieves the row data. The table row data is returned as type Promise<object[]>. |
| OITable | getSelectedIds | - | - | - | - | The IDs of the selected rows are returned as type Promise<(string|number)[]>. |
| OITable | setSelectedIds | string[]|number[] | - | rowIds | Specify an array of IDs of the selected rows. | A Promise<undefined> that waits until the setting is complete is returned. All rows that are not specified become unselected. When an empty array is specified, all selections are cleared. When the Table component's properties.selection is "radio", only the first ID in the array is applied. |
| OITable | getSelectedRows | - | - | - | - | Obtains all data in the selected row of the table and returns it as a Promise<object> type. |
| OITabs | getTabs | - | - | - | - | Obtains an array of all tab information belonging to an instance. Tabs with a visible property of false in the "type: tab" component of the UI YAML file are not included in the array. The return value will be of the same type as the argument of the addTab function. |
| OITabs | addTab | object | - | params | Specify the parameters of the tab to be added. | Adds the specified tab. Returns a Promise<undefined> that waits until the addition is complete. The following will result in a TypeError.
|
| string | - | params.name | Specify the name of the tab to be added. This specifies the name of the Tab component in the UI YAML file. | |||
| string | - | params.id | Specify the internal ID of the tab. Must be unique within the tabs. If omitted, an ID will be automatically assigned. | |||
| string | - | params.label | Specify the label of the tab. If omitted, a label will be automatically assigned. | |||
| boolean | - | params.visible | Specify "true" (show) or "false" (hide). Default is "true". | |||
| string | - | params.queryParameter | Specify the query parameter to be added to the current URL when the tab becomes active in the "key=value" format. | |||
| object | - | params.state | Sets the tab status. | |||
| OITabs | activateTab | number | - | index | Specify the index of the tab to be made active. The default value is 0. | Makes the specified tab active. If index is not an integer, it will result in a TypeError. Returns a Promise<undefined> that waits until the active setting of the tab for the specified index is complete. |
| OITabs | getActiveTab | - | - | - | - | Obtains the active tab. Returns a Promise<undefined> if the active tab is 0. |
| OITab | getForm | string | - | name | Specify the name of the form on the tab. | Obtains the OIForm instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getTable | string | - | name | Specify the name of the table on the tab. | Obtains the OITable instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getTabs | string | - | name | Specify the name of the tab on the tab. | Obtains the OITabs instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getArticle | string | - | name | Specify the name of the article on the tab. | Obtains the OIArticle instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getButton | string | - | name | Specify the name of the button on the tab. | Obtains the OIButton instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getAttachment | string | - | name | Specify the name of the attachment on the tab. | Obtains the OIAttachment instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getCard | string | - | name | Specify the name of the card on the tab. | Obtains the OICard instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getTableDataSource | string | - | name | Specify the name of the data source on the tab. | Obtains the OITableDataSource instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OITab | getLabel | string | - | name | Specify the name of the label on the tab. | Obtains the OILabel instance contained in the content associated with the tab. If there is no name, a TypeError occurs. |
| OIArticle | setAutorefreshSeconds | number | - | secondsValue | Automatic refresh interval (seconds) | Sets the automatic refresh interval. Returns a Promise<undefined> that waits until the setting is complete. If secondsValue is not an integer, it will result in a TypeError. |
| OIAttachment | saveFiles | - | - | - | - | Saves the attachment. Returns a Promise<undefined> that waits until the save is complete. If secondsValue is not an integer, it will result in a TypeError. |
| OICard | setContent | string | - | content | Specify the displayed content. | Sets the displayed content. Returns a Promise<undefined> that waits until the setting is complete. If secondsValue is not an integer, it will result in a TypeError. If there is no name, a TypeError also occurs. |
| OICard | setLink | string | - | link | Specify the link destination. | Sets the link destination. Returns a Promise<undefined> that waits until the setting is complete. If secondsValue is not an integer, it will result in a TypeError. If there is no name, a TypeError also occurs. |
| OIPaper | setVisible | boolean | - | visibility | Specify "true" (display) or "false" (hide). | Specifies whether to display or hide Paper. |
| OILabel | setContent | string | - | content | Sets the value of the label. | A Promise<undefined> that waits until the setting is complete is returned. |
| OILabel | getContent | - | - | - | - | Retrieves the value of the label and returns it as type Promise<string>. |
<Definition example>
async function handleCellClick(_, row) {
const ticketID = row.id;
const tabs = new OITabs('ticket_tabs');
const tabDetails = await tabs.getTabs();
const existingTicketTabIndex = tabDetails.findIndex(
(detail) => detail.id === ticketID,
);
if (existingTicketTabIndex !== -1) {
tabs.activateTab(existingTicketTabIndex);
} else {
tabs.addTab({
name: 'ticket_detail_tab',
id: ticketID,
label: row.number,
queryParameter: 'id=${ticketID}',
});
}
}