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:
|
|
|
|
|
|
|
|
|
|
|
|
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.
Flags Affected: OVER, ZERO
Note the following:
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.
The OVER flag is set if the {return} variable is too small to receive the numeric result.
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.
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.
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.
The optional {flags} parameter is a bit mask value that control behaviors of this
method. The {flags} bit mask values are defined as follows:
|
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. |
The {return} pass\fail values are defined as follows:
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See Also: CLIENT, Client Methods, Method Syntax
![]() |