Phone API Reference - UI Extended - genericConfirm.show
genericConfirm.show
Â
Description
Displays a confirmation prompt to the user. All widgets currently on screen are hidden while the user is prompted for a choice. When the user makes a choice, the widgets are shown again, and a callback is executed with the user's choice passed as a parameter.
Basic Example:Â
genericConfirm.show(parameters); |
Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | No | string | Â | Unique id for the confirmation. If no id is specified, the confirmation widgets will be regenerated each time they are displayed instead of caching. |
message | Yes | string | Â | Confirmation message to display to the user. |
title | Yes | string | Â | String to display in the title bar. |
object | Yes | object | Â | Object containing the 'processConfirm()' method (the callback which is executed when the user presaves a softkey. |
confirmBtnText | No | string | Â | Text to display on the 'confirm' button (softkey 1). |
cancelBtnText | No | string | Â | Text to display on the cancel button (softkey 4). |
hideCancelButton | No | boolean | Â | Boolean value to display the cancel button or not. |
Examples
genericConfirm prompts user to continue
var genericConfirm = require('genericConfirm');
this.processConfirm = function (params) {
    if (params.confirm === true) {
        continue();
    } else {
        digium.background();
    }
};
genericConfirm.show({
    'id'           : 'confirm_1',
    'message'      : 'Would you like to continue?',
    'title'        : 'Confirm',
    'object'       : this,
    'confirmBtnText'   : 'Continue',
    'hideCancelButton' : false,
    'cancelBtnText'    : 'Cancel',
}); |
Â