Search
WindowHost.showConfirmDialog Method
See Also
 






Shows a confirmation dialog.

Namespace: MindFusion.Common.UI
File: WindowHost.js

 Syntax

JavaScript  Copy Code

function showConfirmDialog ([title, [message, [callback]]])

 Parameters

title
Optional.

String. The text to display as a dialog title.

message
Optional.

String. The message to display as the dialog text.

callback
Optional.

function. The callback function to invoke when the dialog is closed.The dialog's modalResult will be passed as a parameter to the callback function.

 Example

The following code renders a confirm dialog and handles the result in a callback method:

JavaScript  Copy Code

host.showConfirmDialog("Confirmation", "This is the value of the data field \n <" + sender.data + "> \n Press OK to keep the value, or Cancel to clear the input", confirmCallback.bind(sender), document.body.children[0], sender.theme);

// This is the callback function of the confirm dialog.
// The parameter stores the modal result of the dialog (e.g. which button was pressed).
function confirmCallback(result)
{
 if (result == ui.ModalResult.Cancel)
 {
  this.data = null;
  this.element.querySelector("#data").value = "";
 }
}

 See Also