Popup windows

69 views
Skip to first unread message

Alex Shure

unread,
Sep 7, 2015, 7:58:32 AM9/7/15
to GWTP
Every time I fire RevealRootPopupContentEvent.fire(this, MyPopupPresenter)
I got error: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'setPopupPositionAndShow_1_g$' of null Unknown.wrap_3_g$(Exceptions.java:36) Unknown.showAndReposition_0_g$(PopupViewImpl.java:156) Unknown.internalReveal_0_g$(PresenterWidget.java:520) Unknown.addToSlot_1_g$(PresenterWidget.java:188) Unknown.addToPopupSlot_0_g$(PresenterWidget.java:166)

Could someone please explain what is the right way of building popups?

Now I have next code:
in presenter:

 @Inject
    private AsyncProvider<PopupPresenter> popupPresenterAsyncProvider;

    @Override
    public void showPopup() {
        popupPresenterAsyncProvider.get(new WeblibAsyncCallback<PopupPresenter>() {

            @Override
            public void onSuccess(PopupPresenter result) {
                if (result != null) {
                     fireRevealRootPopupContentEvent(result);
                }
            }
        });
    }
    private void fireRevealRootPopupContentEvent(
PopupPresenter popupPresenter){
        RevealRootPopupContentEvent.fire(this, popupPresenter);
    }

PopupPresenter extends PresenterWidget<PopupPresenter.PopupPresenterView>
PopupView extends PopupViewImpl<C extends UiHandlers>
in ui.xml I'm using com.sencha.gxt.widget.core.client Dialog
GWT - 2.7
gwtp  -1.4

PS: after I close exception message and make some UI manipulations, this popup is shown. After I press close popup button, page stop response and chrome tab takes 1.5 Gb memory

Richard Wallis

unread,
Sep 7, 2015, 8:11:11 AM9/7/15
to GWTP
SetPopupPositionAndShow is a method in com.google.gwt.user.client.ui.PopupPanel

If you're using PopupViewImpl then you have to use it with a widget that extends from PopupPanel, which the gxt Dialog doesn't.  

You can use the PopupView interface with other kinds of dialogs but you'll need to do a custom implementation.



--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Shure

unread,
Sep 7, 2015, 8:54:49 AM9/7/15
to GWTP
Thank You.

Inspired by this example: https://groups.google.com/forum/?fromgroups#!searchin/gwt-platform/gxt$20window/gwt-platform/7GiAEEgrWrI/eKrMbEvy1H4J

I overrided showAndReposition() method in my wrapper. Now popup appears on click.

But page become unresponsive after I click close popup. Have any idea?
Reply all
Reply to author
Forward
0 new messages