Skip to content

DialogView

The DialogView is used usually for pop-up windows that can optionally block UI until it’s closed. If you need to block the UI until the dialog closes (create modal dialog), you will use showAsync() method. If you need a window that will not prevent your interaction with the background windows, you will use show(...) method.
The DialogView inherits all the methods and properties from the base class View.

Constructor:

  • constructor(parent: App)
    Creates an instance of a DialogView control.
    • parent: app itself.

Properties:

  • caption: string
    The title displayed in the dialog's header.
  • result: any
    Holds the result value returned when the dialog is closed. It is usually the name of the pressed dialog buttons. Also it can be the value you passed to the close(result) method.

Methods:

  • close(handlerOrResult: ((result: any) => boolean) | any)
    If the parameter is a handler function, you will be able to listen to a dialog’s 'close' event. If you return false in the handler, you will prevent the dialog from being closed.
    Otherwise, the parameter will be propagated to the result property and as a result returned by showAsync() method.
  • storeWindowPos(id: string)
    Stores the current position of the dialog. id is a unique identification of your dialog (for example “my_billing_dialog").
  • restoreWindowPos(id: string)
    Restores the position of the dialog window associated with the specified identifier. For example, you must use the same “my_billing_dialog" identifier you used when you called storeWindowPos(“my_billing_dialog") to restore the saved dialog position.