Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-11785

Add modal dialog methods to the ui-extension library

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 13.2.0
    • None
    • None
    • 2
    • Tiger
    • Tiger Sprint 205, Tiger Sprint 206

    Description

      ui.dialog.open(options)
      Opens a modal dialog whose body shows an iframe. The options object can contain the following keys:

      • value (string, optional)
        The current value of the field. For example, can be used by the dialog to preselect the "current item".
      • fullscreen (boolean, optional)
        Whether the dialog is shown (almost) full screen or not. This gives developers two size options: big dialogs and small dialogs.
      • title (string, mandatory)
        The title text of the dialog.
      • url (string, mandatory)
        The URL to load in the iframe.

      Returns a promise. The behavior of the promise depends on how the dialog is closed (see ui.dialog.close() and ui.dialog.cancel() below). When a dialog is already open the promise is rejected directly with the error code "DialogExists" to prevent nested dialogs.

      ui.dialog.options()
      Returns a promise that resolves with the options object of the current open dialog. When no dialog is open, it returns a promise rejected with error code "NoDialog". The code running in the dialog can use this to, for example, get the current value of the field passed in the options.

      ui.dialog.close(value: string)
      Closes the open modal dialog and resolves the promise returned by ui.dialog.open() with the given value. In most cases close() will be called by code running inside the dialog, but it can also be called by code running in the extension. Returns a promise that resolves once the dialog has been closed. When no dialog is open it returns a promise rejected with error code "DialogNotFound".

      ui.dialog.cancel()
      Closes the open dialog and rejects the promise returned by ui.dialog.open() with error code "DialogCanceled". Returns a promise that resolves once the dialog has been closed. When no dialog is open it returns a promise rejected with error code "DialogNotFound".

      Attachments

        Activity

          People

            Unassigned Unassigned
            mmetternich Michael Metternich
            Product Management Team Product Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: