Class DialogBox


Deprecated. The UI service was deprecated on December 11, 2014. To create user interfaces, use the HTML service instead.

A form of popup that has a caption area at the top and can be dragged by the user. Unlike a PopupPanel, calls to setWidth(width) and setHeight(height) will set the width and height of the dialog box itself, even if a widget has not been added as yet.

In general it's not recommended to add this panel as a child of another widget or of the app as that will make it behave like any other inline panel and not act as a popup. Instead, create the popup and then use its show() and hide() methods to show and hide it. See the example below.

Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation directly. You can find the DialogBox documentation here.

Here is an example showing how to use the dialog box widget:


 function doGet() {
   var app = UiApp.createApplication();
   // Create a dialog box.
   var dialog = app.createDialogBox();
   // Set the position and dimensions.
   dialog.setPopupPosition(100, 100).setSize(500, 500);
   // Show the dialog. Note that it does not have to be "added" to the UiInstance.
   return app;

Deprecated methods

Send feedback about...

Apps Script
Apps Script