Carlos Gavidia-Calderon
Carlos Gavidia-Calderon

Reputation: 7243

GWT: Disable dragging in DialogBox

Is it possible to disable dragging in a com.google.gwt.user.client.ui.DialogBox instance? I like my container to have a title bar but it should be in a fixed position and the user shouldn't be capable of moving it.

If it is not possible, what's the GWT widget that fits for the job?

Upvotes: 2

Views: 1849

Answers (1)

pb2q
pb2q

Reputation: 59627

Extend DialogBox, override beginDragging, and use preventDefault to interrupt the drag handling.

Like so:

public class MyDialogBox extends DialogBox
{
   protected void beginDragging(MouseDownEvent e)
   {
      e.preventDefault();
   }
}

See the documentation for DomEvent.preventDefault

Upvotes: 4

Related Questions