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', }); |