Available API Functions
Each Web App Control Project contains the x4-webapp-api.d.ts and x4-webapp-api.js files in the Sources folder. The following functions are available for the X4API
class declared in this files:
Function | Description |
---|---|
init(): Promise<boolean>; | Initializes the connection to the parent custom control component. Return value:
|
getPropertyDefinitions(): Promise<any[]>; | Return value:
|
subscribeToDataModelChanges(func: (v: any) => void): string; | Developers can use this function to react to data model changes by setting the function to process incoming modifications. Return value:
|
| Developers can use this function to react to property changes by setting the function to process incoming modifications. Return value:
|
getPropertyValue(v: string): Promise<string>; | Return value:
|
getPropertyValidationErrors(v: string): Promise<string[]>; | Return value:
|
setPropertyValue(n: string, v: string): void; | Sets the property value by name. |
unsubscribeDataModelChanges(sid: string): void; | Terminates the subscription of data model changes by subscription ID. |
getAllPropertyValues(): Promise<any>; | Return value:
|
unsubscribePropertyValueChanges(sid: string): void; | Terminates the subscription of value changes by subscription ID. |
setControlWidth(value: string): void; | Sets the desired width of the control. Possible values:
|
setControlHeight(value: string): void; | Sets the desired height of the control. Possible values:
|
getControlWidth(): Promise<any>; | Return value:
|
getControlHeight(): Promise<any>; | Return value:
|
getActions(): Promise<any>; | Return value:
|
executeAction(name: string, parameters?: any): Promise<any>; | Accepts the action name and an optional custom parameter array of the Return value:
|