Dialogs Plugin

(part of package 'Servoy Default Services')

You can access it in code via: plugins.dialogs

Properties

API

showErrorDialog(dialogTitle,dialogMessage,buttonsText)

Shows an error dialog with the specified title, message and a customizable set of buttons.

Example:

//show dialog
var thePressedButton = plugins.dialogs.showErrorDialog('Title', 'Value not allowed','OK', 'Cancel');

Parameters:

  • {string} dialogTitle DialogTitle Dialog title.

  • {string} dialogMessage DialogMessage Dialog message.

  • {string...} [buttonsText] ButtonsText variable arguments of button texts..

Returns: string Pressed button or null if closed by escape key


showInfoDialog(dialogTitle,dialogMessage,buttonsText)

Shows an info dialog with the specified title, message and a customizable set of buttons.

Example:

//show dialog
var thePressedButton = plugins.dialogs.showInfoDialog('Title', 'Value not allowed','OK', 'Cancel');

Parameters:

  • {string} dialogTitle DialogTitle Dialog title.

  • {string} [dialogMessage] DialogMessage Dialog message.

  • {string...} [buttonsText] ButtonsText variable arguments of button texts..

Returns: string


showInputDialog(dialogTitle,dialogMessage,initialValue,inputType)

Shows an input dialog where the user can enter data. Returns the entered data, or nothing when canceled.

Example:

//show input dialog ,returns nothing when canceled
var typedInput = plugins.dialogs.showInputDialog('Specify','Your name');

Parameters:

  • {string} [dialogTitle] DialogTitle Dialog title.

  • {string} [dialogMessage] DialogMessage Dialog message.

  • {string} [initialValue] InitialValue

  • {string} [inputType] InputType the type of the input field, one of: color, date, datetime-local, email, month, number, password, tel, text, time, url, week

Returns: string


showQuestionDialog(dialogTitle,dialogMessage,buttonsText)

Shows a question dialog with the specified title, message and a customizable set of buttons.

Example:

//show dialog
var thePressedButton = plugins.dialogs.showQuestionDialog('Title', 'Value not allowed','OK', 'Cancel');

Parameters:

  • {string} dialogTitle DialogTitle Dialog title.

  • {string} dialogMessage DialogMessage Dialog message.

  • {string...} [buttonsText] ButtonsText variable arguments of button texts..

Returns: string


showSelectDialog(dialogTitle,dialogMessage,options)

Shows a selection dialog, where the user can select an entry from a list of options. Returns the selected entry, or nothing when canceled.

Example:

//show select,returns nothing when canceled
var selectedValue = plugins.dialogs.showSelectDialog('Select','please select a name','jan','johan','sebastiaan');
//also possible to pass array with options
//var selectedValue = plugins.dialogs.showSelectDialog('Select','please select a name', new Array('jan','johan','sebastiaan'));

Parameters:

Returns: string


showWarningDialog(dialogTitle,dialogMessage,buttonsText)

Shows a message dialog with the specified title, message and a customizable set of buttons. Returns pressed button text, in case window is closed without pressing any button return value depends on client type.

Example:

//show dialog
var thePressedButton = plugins.dialogs.showWarningDialog('Title', 'Value not allowed','OK', 'Cancel');

Parameters:

  • {string} dialogTitle DialogTitle Dialog title.

  • {string} dialogMessage DialogMessage Dialog message.

  • {string...} [buttonsText] ButtonsText variable arguments of button texts.

Returns: string ** pressed button text



Last updated