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 945187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:42:52+00:00 2026-05-15T22:42:52+00:00

I have a widget (Main.java) which encapsulates funcionality and implements the Async Provider pattern

  • 0

I have a widget (Main.java) which encapsulates funcionality and implements the Async Provider pattern for code splitting. In addition, I use the Prefetching pattern so that the browser downloads the code inmediatly after it loads a Welcome screen.

The problem raises in IE8. If I use the Main widget without doing prefetching, everything is fine. However, if I do prefetch first and then try to use te Main widget, thw browser only shows the center panel of the DockLayoutPanel used by the Main widget.
In Firefox everything works fine.

Here is the code:

//BugTest.java
package com.bugtest.clearadd.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.RootPanel;

    public class BugTest implements EntryPoint {

    @Override
    public void onModuleLoad() {
        Button prefetchButton = new Button("Prefetch!");
        prefetchButton.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                Main.getInstance(new AsyncCallback<Main>() {

                    @Override
                    public void onSuccess(Main result) {
                        PopupPanel popupPanel = new PopupPanel(true);
                        popupPanel
                                .setWidget(new Label("Prefetching finished!"));
                        popupPanel.center();
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        // TODO Auto-generated method stub

                    }
                });
            }
        });

        Button switchButton = new Button("Switch!");
        switchButton.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                Main.getInstance(new AsyncCallback<Main>() {

                    @Override
                    public void onSuccess(Main result) {
                        RootPanel.get().clear();
                        RootLayoutPanel.get().add(result);
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        // TODO Auto-generated method stub

                    }
                });
            }
        });

        FlowPanel flowPanel = new FlowPanel();
        flowPanel.add(new Label("Bug test!"));
        flowPanel.add(prefetchButton);
        flowPanel.add(switchButton);

        RootPanel.get().add(flowPanel);
    }

}

//Main.java
package com.bugtest.clearadd.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ResizeComposite;

public class Main extends ResizeComposite {

    private static Main instance = null;

    public static void getInstance(final AsyncCallback<Main> callback) {
        GWT.runAsync(new RunAsyncCallback() {

            @Override
            public void onSuccess() {
                if (instance == null) {
                    instance = new Main();
                }
                callback.onSuccess(instance);
            }

            @Override
            public void onFailure(Throwable reason) {
                callback.onFailure(reason);
            }
        });
    }

    private Main() {
        DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.EM);
        dockLayoutPanel.addNorth(new Label("North!"), 7);
        dockLayoutPanel.addWest(new Label("West!"), 15);
        dockLayoutPanel.add(new Label("Center! :D"));
        initWidget(dockLayoutPanel);
    }

}

Does anyone know what it could be? Thanks in advance.

EDIT: I noticed that if I change the DockLayoutPanel units to PX, everything works fine. Is it a bug or I am missing something? Thanks again. 😛

  • 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-05-15T22:42:52+00:00Added an answer on May 15, 2026 at 10:42 pm

    I realized that this issue has nothing to do with Code Splitting. I removed the GWT.runAsync function and the same problem still shows up.
    The problem is more likely to be related to DockLayoutPanel, the unit EM, and the design pattern, so this problem should be posted in another question.
    More specifically, I changed tha Async Provider pattern fot a Singleton pattern and the problem still shows up.
    And again, if I change the units from EM to PX, the problem seems solved.
    Thanks anyway!

    EDIT: I posted the new characteristics of this problem in this post:
    https://stackoverflow.com/questions/3313981/gwt-ie8-problem-with-composite-over-docklayoutpanel-the-unit-em-and-the-single

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

Sidebar

Related Questions

I have a widget that is a part of my main app. Usually when
I have a widget that supposed to call an Activity of the main app
I have a wx.Frame, in which there is a main wx.Panel with several widgets
I have the following code which searches a text file on my phone's sd
I want to use simple snmp get in android.I found the code for java
I have a mainActivity which is Customer.java with listview of 5 diff. activities. I
This is my code in my main java file. How would i make another
Basically I have written a custom widget, which is going to be displayed 5
In my main code I have: String TableLayout = TAB01; dbWorker db = new
I have a widget that sits within a stacked widget and is used to

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.