Friday, 9 September 2011

GWT: creating a dialog prompt or popup panel

The class to use is DialogBox or PopupPanel and both are pretty straightforward to use. You just create an instance of DialogBox (or PopupPanel), make calls to the set methods you need (setTitle(,,,), setText(...), setAnimationEnabled(...), setGlassEnabled(...), addStyleName(...), setWidget(...) etc) and then call the DialogBox's show() or center() method to show it and the DialogBox's hide() method to hide it.

The only differences I see right now (I'm sure there are others) is that a DialogBox can be dragged around by the user and a PopupPanel on the other hand has an auto-hide property which could be handy.

1 comment: