Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7970277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:22:22+00:00 2026-06-04T07:22:22+00:00

I am using SmartGWT 3.0 and GWTP 0.7. I am trying to do a

  • 0

I am using SmartGWT 3.0 and GWTP 0.7.

I am trying to do a simple PresenterWidget showing a SmartGWT Window. This is the code for the widget presenter:

import com.gwtplatform.mvp.client.PresenterWidget;
import com.gwtplatform.mvp.client.PopupView;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;

public class DemoWidgetPresenter extends
    PresenterWidget<DemoWidgetPresenter.MyView> {

public interface MyView extends PopupView {
}

@Inject
public DemoWidgetPresenter(final EventBus eventBus, final MyView view) {
    super(eventBus, view);
}

@Override
protected void onBind() {
    super.onBind();
}

@Override
protected void onReveal() {
    super.onReveal();
    System.out.println(">>>> onReveal()");
}
}

And the view code:

import com.gwtplatform.mvp.client.PopupViewImpl;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.google.gwt.user.client.ui.Widget;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.CloseClickEvent;
import com.smartgwt.client.widgets.events.CloseClickHandler;

public class DemoWidgetView extends PopupViewImpl implements
    DemoWidgetPresenter.MyView {

private Window winModal;

@Inject
public DemoWidgetView(final EventBus eventBus) {
    super(eventBus);

    winModal = new Window();
    winModal.setWidth(300);
    winModal.setHeight(500);
    winModal.setTitle("Export file");
    winModal.setShowMinimizeButton(false);
    winModal.setIsModal(true);
    winModal.setShowModalMask(true);
    winModal.centerInPage();
    winModal.setCanDragResize(true);
    winModal.addCloseClickHandler(new CloseClickHandler() {
        @Override
        public void onCloseClick(CloseClickEvent event) {
            winModal.hide();
        }
    });
}

@Override
public void center() {
    winModal.centerInPage();
}

@Override
public void hide() {
    winModal.hide();
}

@Override
public void setPosition(int left, int top) {
    winModal.setLeft(left);
    winModal.setTop(top);
}

@Override
public void show() {
    winModal.show();
}

public Widget asWidget() {
    return winModal;
}
}

In another part of the program I show this presenter with:
addToPopupSlot(dp, true);

Where dp is an injected instance of DemoWidgetPresenter.

When DemoWidgetPresenter is show the folowing Exception is raised:

com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full                                    set in UmbrellaException#getCauses
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at     com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.smartgwt.client.widgets.Window cannot be cast to com.google.gwt.user.client.ui.PopupPanel
at com.gwtplatform.mvp.client.PopupViewImpl.asPopupPanel(PopupViewImpl.java:130)
at com.gwtplatform.mvp.client.PopupViewImpl.setCloseHandler(PopupViewImpl.java:104)
at com.gwtplatform.mvp.client.PresenterWidget.monitorCloseEvent(PresenterWidget.java:574)
at com.gwtplatform.mvp.client.PresenterWidget.addToPopupSlot(PresenterWidget.java:205)
at com.demo.client.core.mvp.DiffPresenter$9.onClick(DiffPresenter.java:397)
at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:96)
at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)

I see the problem is due to a casting between
com.smartgwt.client.widgets.Window and
com.google.gwt.user.client.ui.PopupPanel but I don’t know how to solve it!

Despite the Exception, the window is shown, but function onReveal() is never call, so the presenter live cycle is broken..

Any idea/workaround :-)?

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:22:23+00:00Added an answer on June 4, 2026 at 7:22 am

    I found a solution doing an adapter class:

    import com.google.gwt.event.logical.shared.CloseEvent;
    import com.google.gwt.event.logical.shared.CloseHandler;
    import com.google.gwt.event.shared.HandlerRegistration;
    import com.google.gwt.user.client.ui.PopupPanel;
    import com.gwtplatform.mvp.client.PopupView;
    import com.gwtplatform.mvp.client.PopupViewImpl;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.CloseClickEvent;
    import com.smartgwt.client.widgets.events.CloseClickHandler;
    
    /**
     * Adapter class for {@link Window}. This class it is necessary when a
     * {@link PopupView} uses as widget a {@link Window}. GWTP library does an
     * explicit cast to {@link PopupPanel} in {@link PopupViewImpl} and a cast
     * exception is raised. This class adapts only these functions which are call in
     * {@link PopupViewImpl}.
     * 
     * 
     */
    public class PopupPanelAdapter extends PopupPanel {
    
    private Window delegate;
    
    public PopupPanelAdapter(Window delegate) {
        this.delegate = delegate;
        // adapting window close event
        delegate.addCloseClickHandler(new CloseClickHandler() {
            @Override
            public void onCloseClick(CloseClickEvent event) {
                CloseEvent.fire(PopupPanelAdapter.this, null);
            }
        });
    }
    
    public void hide() {
        delegate.hide();
    }
    
    public void show() {
        delegate.show();
    }
    
    @Override
    public HandlerRegistration addCloseHandler(CloseHandler<PopupPanel> handler) {
        return super.addCloseHandler(handler);
    }
    
    @Override
    public boolean isShowing() {
        return isVisible();
    }
    
    @Override
    public void center() {
        delegate.centerInPage();
    }
    
    @Override
    public void setPopupPosition(int left, int top) {
        if (delegate == null)// call in constructor, delegate is null
            return;
        delegate.setLeft(left);
        delegate.setTop(top);
    }
    }
    

    It works fine!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using GWT 2.0.x and SmartGWT 2.2 Code as simple as: public class SmartGwtTest
i wrote a code to zoom in, and zoom out an image using smartGWT.
I'm trying to populate a smartgwt calendar using data form a server obtained using
I am using a smartgwt window to show some dynamic content. The content is
I am developing a GWT application using GWT, SmartGWT and GWTP. At the beginning
I'm trying to get a SmartGWT Window sizing based on its contents. The correct
We're using GWT 2.03 along with SmartGWT 2.2. I'm trying to match a regex
I am trying to get started with SmartGwt. I am using the XJSONDatasource to
I am trying to use smart Gwt, Listgrid. I am using both com.google.gwt.user.client.ui and
I have been using SmartGWT but have run into trouble mixing SmartGWT with other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.