dialogopen
This article is about the dialogopen UDB event handler.
dialogopen
The dialogopen event may be called from web pages developed in Web Designer and processed by a USoft page engine service.
| Event | Applies to | Occurs when |
|---|---|---|
dialogopen | Dialog controls | Right after a dialog has been shown |
This event is triggered on the dialog's own <dialog> element right after the dialog is shown, and it applies to any of the following kinds of dialog: a custom dialog placed on a page in Web Designer (triggered by DialogControl.show(), defined in controls/dialog-control.js); a lookup, confirmation, or other data-input dialog raised by DataInputControl.show() (defined in controls/data-input-control.js), for example the dialog that $.udb.input() opens to prompt the user for values; and a pre-existing "system" dialog that is already present in the page markup and is opened by id through the standalone $.udb.dialog() helper function (udbDialog, defined in usoft.module.controls.js). Both DialogControl and DataInputControl are subclasses of UdbControl.
Purpose
You can use this event to run code as soon as a dialog becomes visible, for example to set focus on a particular field, prefill values, or start a timer.
How to use
Find or create an Event Listener object with Event Type = dialogopen. Event Listeners are in the Web Designer Controls catalog:
Insert the event listener into the dialog control. Insert a callClientScript action into the event listener. Use this action's Script property to code the behaviour that you want to see when the event occurs.
You are implicitly associating the event with an event handler function. This function has an options parameter. For available options, see the Options section at the end of this help topic:
function(*evt*, *options*){ ... }
Or you can create the event handler more explicitly by attaching a jQuery handler on the control's element.
No options object is passed to the event handler function; the event is a plain notification that the dialog is now open.