AppDialog Method (CLIENT)
PLB Web Only, 9.9
The AppDialog method allows access to a mobile device dialog UI elements. 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.
text
Required. A Character String Variable or string literal giving the text to be displayed in the dialog.
title
Optional. A Character String Variable or string literal giving the title to be displayed in the dialog.
button
Optional. A Character String Variable or string literal that contains one or more button names. Button names are separated by ';' characters.
defaultText
Optional. A Character String Variable or string literal giving the default text for an edit field used in a Prompt dialog.
Flags Affected: OVER, ZERO
Note the following:
This method is only used for a Sunbelt PL/B Web Client App using Cordova\PhoneGap operations. See the following link for details on the Cordova plugin used:
https://www.npmjs.com/package/cordova-plugin-dialogs
The ZERO flag is set when the {return} value is zero.
The OVER flag is set if the value returned is too large to be stored into the {return} variable.
The type of mobile device dialog is determined by which parameters are specified for the AppDialog method as follows:
If
a single button is used with no 'DefaultText' text, an Alert dialog is used.
If
multiple buttons are used with no 'DefaultText' text, a Confirm Dialog is used.
If
'DefaultText' text is provided, a Prompt Dialog is used which prompts the end-user for data input.
This method starts an asynchronous operation on the mobile device which returns the result using the 'AppEventDialog' CLIENT object event where the event data is returned in ARG1 which contains a JSON notation stream.
The event number used in EVENTREG is:
The event result is defined as follows:
Alert Dialog
|
Field |
Description |
|
ARG1 |
No data returned on event. |
|
Modifier |
The button number (always 1) |
Confirm Dialog
|
Field |
Description |
|
ARG1 |
No data returned on event. |
|
Modifier |
The button number |
Prompt Dialog
|
Field |
Description |
|
ARG1 |
Prompt edit text data returned as plain text (i.e., not JSON). |
|
Modifier |
The button number |
Example Code
See Also: CLIENT, Client Methods, Method Syntax
![]() |