JavaScript API
The OutSystems JavaScript API allows you to call OutSystems specific actions and act upon mobile app events in your JavaScript code, to tweak and customize the mobile app experience of the final user using the JavaScript flow element. For example, to show and hide feedback messages in JavaScript, or handle application upgrade/load events in a specific way.
The available API modules can be accessed through the predefined object “$public”. This object contains references to each supported JavaScript API.
The following example shows how to call the “showFeedbackMessage” function of the “FeedbackMessage” module:
$public.FeedbackMessage.showFeedbackMessage("Your data has been submitted.", 1);
Summary
Modules | |
---|---|
ApplicationLifecycle | Provides information about the status of the application's lifecycle. Used to protect the app during upgrades, when local model access shouldn't be allowed, and to customize the application loading process. |
Device | Provides methods to access native capabilities of the device. |
FeedbackMessage | Displays feedback messages to the user. Used to display personalized feedback messages, specifying options like custom style and auto-close behavior. |
Logger | Provides methods to log messages or errors. Used as "console.log" but also logs messages in Service Center. |
Security | Provides methods for doing client side role checks. Used to programmatically show or hide UI elements depending on a given role. |
Classes | |
---|---|
Navigation | Provides the ability to perform normal and history navigations, and to override some navigation behaviors (e.g. back). Used to create new transition animations instead of overriding the existing ones using CSS. |
Validation | Provides methods to show validation messages on widgets and set their validation values. Used when validating widgets inside iterators, since it's not possible to do it in the usual way. |
View | Provides methods to deal with active view components and their state. |
Type aliases | |
---|---|
ApplicationLoadEventHandlers | Event handlers called when the status of the application load changes. |
Type aliases
ApplicationLoadEventHandlers
ApplicationLoadEventHandlers: object
Event handlers called when the status of the application load changes.
Used in ApplicationLifecycle.listen function.
Type declaration
(Optional) onLoadComplete: function
Callback for when the application is fully loaded and ready to use.
(): void
Returns: void
(Optional) onUpgradeProgress: function
Callback for when there is progress, during a version upgrade.
(loaded: number, total: number): void
Parameters:
- loaded: number
- total: number
Returns: void
Articles in this Section
- ApplicationLifecycle
- Provides information about the status of the application's lifecycle. Used to protect the app during upgrades, when local model access shouldn't be allowed, and to customize the application loading process.
- Device
- Provides methods to access native capabilities of the device.
- FeedbackMessage
- Displays feedback messages to the user. Used to display personalized feedback messages, specifying options like custom style and auto-close behavior.
- Logger
- Provides methods to log messages or errors. Used as "console.log" but also logs messages in Service Center.
- Navigation
- Provides the ability to perform normal and history navigations, and to override some navigation behaviors (e.g. back). Used to create new transition animations instead of overriding the existing ones using CSS.
- Security
- Provides methods for doing client side role checks. Used to programmatically show or hide UI elements depending on a given role.
- Validation
- Provides methods to show validation messages on widgets and set their validation values. Used when validating widgets inside iterators, since it's not possible to do it in the usual way.
- View
- Provides methods to deal with active view components and their state.