Class DialogBox

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.
dialog.show();
return app;
}

Parameters

Return

addCloseHandler(handler)

Deprecated. This function is deprecated and should not be used in new scripts.

Add a handler for close events.

Note that you can have multiple handlers for the same event on the same widget. They will be
called in the order that they were added to the widget, although ServerHandlers may appear to happen
simultaneously.

The handler passes back some information to the server about what happened. This information
can be accessed as follows:

Parameters

Return

setGlassEnabled(enabled)

Deprecated. This function is deprecated and should not be used in new scripts.

Enable or disable a "glass" pane.

When enabled, the background will be blocked with a semi-transparent pane the next time it
is shown. If the DialogBox is already visible, the glass will not be displayed
until it is hidden and shown again.

Parameters

Return

setPreviewingAllNativeEvents(previewing)

Deprecated. This function is deprecated and should not be used in new scripts.

When enabled, the DialogBox will preview all native events, even if another popup
was opened after this one.

What this practically means is that if autoHide is enabled, enabling this feature will cause
the DialogBox to autoHide even if another non-modal popup was shown after it. If
this feature is disabled, the DialogBox will only autoHide if it was the last
popup opened.

Parameters

Return

setStyleAttributes(attributes)

Deprecated. This function is deprecated and should not be used in new scripts.

Sets this DialogBox's style attributes. This is a convenience method that is equivalent
to calling setStyleAttribute with every key/value pair in the attributes object. Valid
attributes are listed here; the values for each
attribute are the same as those available in CSS style sheets.