Inside a mobile Javascript action

Every time an event fired within the app must be captured to perform something, an action must be defined an linked to the event. Basically, this is what the Web Designer allows to define. An action is expressed as a set of Javascript instructions.

This language has been setchosen because it can be interpreted by both the platforms: iOS and Android, so you can define once the application and use it on any platform, thanks to the portability of Javascript. reload Platform provides a series of utility methods you can incllude in your Javascript scriptlets, described below.

Independently of the javascript code you'll include in your actions, bear in mind that the javascript code must be interpreted on the embedded js interpreter for iOS and Android. These interpreters are not as good as the ones available for desktop computers. showm There are a view limitations you have to take into account when writing javascript code:

Independently of the type of component embedding the Javascript (a mobile action or a business component), a few predefined objects are always available:

  • vo

    • the javascript representation of the json string passed through the Ajax request

  • optionalParams

    • passed as input parameters from the component invoking the action

Moreover, some of the buit-in mobile javascript methods are related to SQL instructions. For those functions, Platform allows to specify SQL instructions including binding variables. These binding variables are always defined using the notation:

:XXX

where XXX is the variable name, always in upper case.

These variables will be automatically replaced by the corresponding values available at user session level.

The user session is composed of a set of variables:

  • predefined variables, automatically set by Platform, when the user starts the app

  • custom variables, defined using the setUserSessionVariable mobile javascript method

  • input parameters, passed to the business component/javascript

The predefined variables are:

Last updated