Skip to main content

JavaScript API

TheFlex offers a JavaScript API to access device- or browser-specific functions from websites or Fiori apps. This can be used to implement additional functions such as:

  • Safely save and load offline data. This can be used to securely and persistently cache offline data, ensuring that it cannot be automatically deleted by the browser.
  • Access to backhand scanners, such as receiving scanned data, showing information on the scanner's display, or triggering actions such as blinking the LEDs.
  • Use of hardware on the device, such as Bluetooth, NFC or GPS.

Controlling the keyboard

The keyboard can be controlled using the following two commands:

Keyboard.hide();

Keyboard.show();
Note

This control is made possible via the Cordova Keyboard Plugin. However, this does not need to be integrated, as TheFlex automatically makes this plugin available to every app.

Startpage Data: Creating & Reading

When creating a startpage, there's an option to set a username and password. These login credentials are used for prefilling in Fiori apps.

Create Launchpad

However, it may happen that the automated prefilling doesn't work on the specified launchpad. In such cases, a browser script can be written to automate the login process. Thanks to our browser API, you can easily access the launchpad data:

FlxMultiUrls.currentLaunchpadData;

This will provide you with all the data related to the respective launchpad.

If you want to access specific data of a launchpad in your script, simply append the variable name:

FlxMultiUrls.currentLaunchpadData.Name;
FlxMultiUrls.currentLaunchpadData.URL;
FlxMultiUrls.currentLaunchpadData.Username;
Caution

Any website can read these data. Only enter your username and password if you intend to open exclusively internal websites and apps that you have full control over.