Interactive Dialogs
Last updated
Last updated
We've provided a few commands to interact with the user through dialogs.
Simple in the sense that the dialogs present the user with a short message and one or two buttons.
The Alert dialog is a way to notify the user of important information with an "OK" button.
Example: The following display a modal dialog.
No return value.
The Confirmation dialog is a way to verify with the user before proceeding.
Example: The following displays a modal dialog with an OK or Cancel confirmation.
Button Name | Return Value |
---|---|
OK | yes |
Cancel | no |
Example: The following displays an input dialog for text.
Button Name | Return Value |
---|---|
OK | < user input > |
Cancel | $null |
Example: The following displays an input dialog with a error validation message.
The Read-Variable
command provides a way to prompt the user for information and then generate variables with those values.
Example: The following displays a dialog with a dropdown.
Note: The name selectedOption will result in a variable that contains the selected option.
Button Name | Return Value |
---|---|
OK | ok |
Cancel | cancel |
< variables > | < selection > |
Supported Parameter Values
Key | Type | Description | Example |
---|---|---|---|
Name | string | Variable name | isSilent |
Value | bool string int float datetime Item | Default value | $true |
Title | string | Header or Label | "Proceed Silently |
Tooltip (optional) | string | Short description or tooltip | "Check to run quietly |
Tab (optional) | string | Tab title | "Simple" |
Placeholder (optional) | string | Textbox placeholder | "Search text..." |
Lines (optional) | int | Line count | 3 |
Editor (optional) | string | Control type | "date time" |
Domain (optional) | string | Domain name for security editor | "sitecore" |
Options (optional) | string OrderedDictionary Hashtable | Data for checklist or dropdown | @{"Monday"=1;"Tuesday"=2} |
Columns | int string | Number between 1 and 12 and string 'first' or 'last' | 6 first |
Editor Types
bool
check
date
date time
droplist
droptree
groupeddroplink
groupeddroplist
info
item
link
marquee
multilist
multilist search
multiple user
multiple user role
multiple role
multitext
number
pass
radio
rule
rule action
tree
treelist
tristate
time
The Confirmation Choice dialog allows for multiple combinations like that seen with a "Yes, Yes to all, No, No to all" scenario.
Example: The following displays a modal dialog with choices.
Note: The hashtable keys should be incremented like btn_0, btn_1, and so on. The return value is the key name.
Button Name | Return Value |
---|---|
< first button > | btn_0 |
< second button > | btn_1 |
< third button > | btn_2 |
The Upload dialog provides a way to upload files from a local filesystem to the media library or server filesystem.
Example: The following displays an advanced upload dialog.
No return value.
The Download dialog provides a way to download files from the server to a local filesystem.
Example: The following displays a download dialog.
The Field Editor dialog offers a convenient way to present the user with fields to edit.
Example: The following displays a field editor dialog.
Button Name | Return Value |
---|---|
OK | ok |
Cancel | cancel |
The File Browser is an obvious choice when you need to upload, download, or delete files.
Example: The following displays a file browser dialog for installation packages.
Button Name | Return Value |
---|---|
OK | < selected file > |
Cancel | undetermined |
Example: The following displays a simple file browser dialog.
Button Name | Return Value |
---|---|
OK | < selected file > |
Cancel | undetermined |
Example: The following displays a Sheer UI control without any additional parameters.
The "Data List" is essentially a report viewer which supports custom actions, exporting, and filtering.
Example: The following displays a list view dialog with the child items under the Sitecore tree.
The Results dialog resembles the Console but does not provide a prompt to the user. This is useful for when logging messages.
Example: The following displays a dialog with the all the information written to the ScriptSession output buffer.