An "OK" button that the user can press to close the dialog and complete any associated action. If this defines an onUse function, that function will be called when the button is clicked. If it does not return true, the dialog will be prevented from closing.
If defined, this function will be called before the dialog is closed, no matter what action caused the close process to begin. If it does not return true, the dialog will not close.
If defined, this function will be called after the dialog is fully constructed but before it is shown. If it does not return true, the dialog will not be shown.
A "Cancel" button that the user can press to close the dialog without completing any associated action. If this button is specified, it will also be "clicked" if the user tries to close the dialog by pressing Escape or clicking outside of the dialog. If this button is not specified, the dialog will simply close in these cases. If the button defines an onUse function, that function will be called when the button is clicked. If it does not return true, the dialog will be prevented from closing.
An array of form controls that will be added to the dialog in the order listed. Any controls that define an id
property can be looked up from this array by their id in addition to their array index.
If defined, this function will be called after the dialog closes. Any return value is ignored.
The optional x-offset at which to display the centre of the dialog, relative to the left edge of the document. The actual location of the dialog may be adjusted to ensure visibility. When defined, pageY must also be set. When no explicit position is given for the dialog, it will be centered at the top of the window.
The optional y-offset at which to display the top of the dialog, relative to the top edge of the document. The actual location of the dialog may be adjusted to ensure visibility. When defined, pageX must also be set.
The dialog's title text.
If called while the dialog is showing, this will close the dialog. This function is added automatically by the toolkit when the dialog is shown. Calling this will not trigger either the accept or cancel buttons. To simulate the user choosing the accept (OK) button, use template.acceptButton.element.click()
. Similarly, to simulate the cancel button, use template.cancelButton.element.click()
.
If called while the dialog is showing, this will update the rebuild the dialog as if a widget handler function (such as onUse
) returned true. This function is added automatically by the toolkit when the dialog is shown.
If called while the dialog is showing, this will update the widget states as if a widget handler function (such as onUse
) returned false. This function is added automatically by the toolkit when the dialog is shown.
This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.
A template that declaratively describes a dialog box, its contents, and its logic.