AppSetOffLine Method (CLIENT)


PLB Web Only, 9.9B

 

The AppInstallOffLine method sets the user web app html, css, and javascript file names to be executed by the 'Plbwebcli' client when a SHUTDOWN instruction is executed or when the 'Plbwebcli' client goes offline. This method allows a PL/B program executed by a PWS runtime to start an offline user web app. The method uses the following format:

 

[label]

{object}.AppSetOffLine

[GIVING {return}] USING [*HTML=](html}][:

 

 

[*CSS=]{css}][,[*JS=]{js}][:

 

 

[*Options=]{flags{]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A CLIENT object.

return

Optional. A Numeric Variable that returns the success or failure of the method.

html

Optional. A Character String Variable or string literal that specifies the file name of a HTML file located in the persistent storage of a mobile device.

css
Optional. A Character String Variable or string literal that specifies the file name of a CSS file located in the persistent storage of a mobile device.
js
Optional. A Character String Variable or string literal that specifies the file name of a file that contains JavaScript and is located in the persistent storage of a mobile device.
flags
Optional. A Numeric Variable or decimal number that specifies a bit mask value that controls the behaviors of this method.

Flags Affected: OVER, ZERO

Note the following:

  1. The ZERO flag is always set when the {return} value is zero which indicates that the method execution was successful. The ZERO flag is clear if the {return} value is not zero which indicates that the method execution failed.

  2. The OVER flag is set if the {return} variable is too small to receive the numeric result.

  3. The {html} parameter contains the file name of a HTML file that has been previously downloaded into the persistent storage on a mobile device. The contents of the HTML file need only contain the HTML <body> contents a web page. The <body> and </body> tags are not included in the HTML file data. The HTML file can also include JavaScript <script> routines.

  4. The optional {css} parameter contains the file name of a CSS file that has been previously downloaded into the persistent storage of a mobile device. The CSS file data contains the classes used in support of the user web app.

  5. The optional {js} parameter contains the file name of a JavaScript file that has been previously downloaded into the persistent storage of a mobile device. The JavaScript file data contains the JavaScript routines used to support the offline user web app. There is a special JavaScript function name 'ProgramStart' function that must exist in the JavaScript routines or in the HTML file contents. The 'Plbwebcli' client executes the 'ProgramStart' function to start the execution of the user offline web app.

  6. The optional {flags} parameter is a bit mask value that control behaviors of this method. The {flags} bit mask values are defined as follows:
     

  7. Value

    Meaning

    0

    Start the offline web app execution with jQuery Mobile support. This is the default.

    1

    Start the offline web app execution without jQuery Mobile support.

    2

    Start the offline web app when the 'Plbwebcli' client encounters an error or a shutdown event occurs.

    4

    Only start the offline web app when a shutdown event occurs.

     

  8.  The {return} pass\fail values are defined as follows:
     

  9. Value

    Meaning

    0

    The method executed successfully.

    1

    Cordova is not supported

    2

    The method failed and extended error information can be retrieved using the CLIENT 'AppExtendedError' method..

 

Example:

 

Start an offline user web app when a PL/B program executes a SHUTDOWN instruction.

 

 

 

Client.AppSetOffline

Using "t1.html": //Html file.

 

 

"t1.css": //CSS file.

 

 

"t1.js" //JavaScript file.

 

 

 

 

SHUTDOWN

//Shutdown PL/B program and start user web app.

 

 

See Also: CLIENT, Client Methods, Method Syntax



PL/B Language Reference AppPickContact Method (CLIENT) AppScanBarCode Method (CLIENT)