Closing a GXT Window Widget That Extends PopupViewWithUiHandlers

382 views
Skip to first unread message

Derek Perriero

unread,
Oct 18, 2012, 11:46:25 AM10/18/12
to gwt-pl...@googlegroups.com
I've been trying with all my might to get this GXT Window to close after calling addToPopupSlot(popupPresenterWidget) in the parent PresenterWidget.

I'm using code from http://vivagwt.blogspot.com/ to extend the PopupViewWithUiHandlers, so that they work with GXT's Window. The window is displaying correctly, but the UiHandlers are acting funny and I'm not able to call getView().hide() on the Popup Presenter, so that the Window will close.  Its like its perpetually being re-displayed.

For Example:

Popup Presenter
@Override
public void onCloseWindow() {
                Window.alert("Foo bar!"); <---- This works.
getView().hide(); <------ This doesn't work.
}

Popup View
@UiHandler("closeButton")
void onCloseButtonClicked(SelectEvent event) {
if (getUiHandlers() != null) {
getUiHandlers().onCloseWindow();
}
}

Popup UiHandler
void onCloseWindow();

I've even created an event to relay the Close action to the parent presenter and within the parent PresenterWidget called an addToPopupSlot(null) with no results.

Any help would be great.

Thanks,
Derek

Derek P

unread,
Oct 18, 2012, 3:06:54 PM10/18/12
to gwt-pl...@googlegroups.com
Here's an update:

I decided to not use the GXT Window and use a PopupPanel with a nested FramePanel from GXT instead.  Everything is fine now.  Here is a tip for anybody else who experiences multiple windows when calling addToPopupSlot(), make sure that the popup view doesn't call uiBinder.createAndBindUi(this), but rather put it in the constructor when dealing with PopupView.


Thanks,
Derek

Brandon Donnelson

unread,
Oct 23, 2012, 1:11:23 PM10/23/12
to gwt-pl...@googlegroups.com
Thanks for the info. 

https://github.com/ArcBees/GWTP/issues/13 - I'm going to investigate next time I'm in the lib. :)
Reply all
Reply to author
Forward
0 new messages