Custom HTML Dialog Boxes

Applies to HTML Viewer, IE Browser publications.

HTML Executable lets you display your own dialog boxes to end users. Dialog boxes are actually HTML pages associated to a HEScript script.

The HTML pages used to create dialogs are called System HTML pages and managed on their dedicated tab.

Click this button to display a blank dialog box:

imgYou will find ready-to-use dialog templates in the "CustomDialogs" subfolder of HTML Executable. You should start writing a custom dialog from the DummyDialog template. This folder also contains a Readme.txt with additional instructions that you should read.

imgCustom dialogs (HTML pages and scripts) are stored in XML files. HTML Viewer and IE Browser publications do not share the same system HTML pages because their HTML engines are not the same. Consequently, a XML file contains two versions of the dialog: one for HTML Viewer publications, and one for IE publications.

imgWhen a custom dialog is imported, both the system HTML page and its script are added to their respective lists (System HTML pages and User Scripts). You are also prompted to provide an identifier for the new dialog. This identifier is used to invoke the dialog box with scripting.

imgAn identifier for an user-imported dialog always begins with "user" + a unique alphanumeric expression.

imgA script for a custom dialog contains script events that are called by form controls like the OK or Cancel buttons:

  • procedure OnInitialization; is called before the dialog box is shown.
  • procedure OnShowDialog2; is called when the dialog box is displayed.

Important: to close the current dialog box, you should call the CloseCurrentDialog HEScript function.

imgTo invoke a custom dialog, use the DisplayCustomDialog HEScript function. For instance,

DisplayCustomDialog("dialog identifier", false);

For further details, please see Readme.txt in the "CustomDialogs" subfolder of HTML Executable.

Example of a full dialog script:

procedure OKDialog;
begin
// Close the dialog.
CloseCurrentDialog;
end;

procedure OnInitialization;
begin
// Ensure the <div> named divreg is visible
ShowHTMLBlockID("divreg", true);
end;