Mike Voitenko
Mike Voitenko

Reputation: 133

Set focus after window hide in GXT

I have such issue - for example, when I'm clicking on grid cell - there appears gxt window(gxt popup, gxt dialog, etc. Not native browser/OS dialogs). After window usage, when it became hidden - grid losts its focus. How I can resolve this problem?

Upvotes: 0

Views: 301

Answers (1)

Mike Voitenko
Mike Voitenko

Reputation: 133

So I've just added method

protected native Element getActiveElement() /*-{
    return $wnd.document.activeElement;
}-*/;

which saves current active element in private field Element savedElement, into overriden Window.onLoad(). Then I just call savedElement.focus() from that element in Window.onHide(). That's all.

Upvotes: 1

Related Questions