This method opens a built-in modal sheet dialog. The
basics::dictionary object
parameter can contain the following keys:
- titleText - The label for the dialog window title.
- bodyText - The label for the dialog body.
- subText - The label below the body text.
- dialogType - The dialog type. Possible values are:
- alert - Alert dialog box
- confirm - Confirm dialog box
- prompt - Prompt dialog box
- checkboxConfirm - Confirm dialog box with checkbox
- confirmButton - Custom label for the confirm button.
- cancelButton - Custom label for the cancel button
- alternateButton - Label for an alternate button. This will add an extra
button to the right of the existing buttons.
- results - An object that will have 3 properties set on return
- results - boolean. True is ok/yes button was pressed, else false.
- checked - boolean. True is check box is checked.
- inputText - string. The string that was entered in the input box.
- buttonLabel - string. The label of the button pressed.
- checked - Set to "true" to have checkbox checked when dialog displays. This
key is only valid for 'checkboxConfirm' dialog type
- checkText - The label to use with the checkbox on the dialog. This key is
only valid for 'checkboxConfirm' dialog type.
- inputText - The text to pre-populate the input box for prompt dialogs. This
key is only valid for 'prompt' dialog type.
- messageIcon - The image file to use as the message icon. (i.e.
box://ocpToolkit/resources/myMessageIcon.png)
- messageIconWidth - The width of the image file to use as the message icon.
If this value is not given, then the true image width is used.
- messageIconHeight - The height of the image file to use as the message icon.
If this value is not given, then the true image height is used.
- errorCode - The error code string to display in the dialog.
- width - The custom width of the dialog window.
- height - The custom height of the dialog window.
- customBackgroundColor - The custom color for the screen to place over the parent window.
- customBackgroundOpacity - The custom opacity for the screen to place over the parent window (% value).
- boxToOverlay - The box object to overlay the backgroud tint over.
function onSample()
{
var results = new Object();
var params = shell.serviceManager.basics.dictionary;
params.setValueForKey("Hello World", "titleText");
params.setValueForKey("Hello Boxely world", "bodyText");
params.setValueForKey("alert", "dialogType");
params.setValueForKey(results, "results");
scene.openSheetDialog(params);
if (results.results)
{
// confirmed
}
else
{
// cancelled
}
}