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

Ask A Question

Stats

  • Questions 508k
  • Answers 508k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The only place you create a new list is in… May 16, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer You may want to try the following: function getRandom_marker(bounds) {… May 16, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer Have you tried respond_to? def index respond_to do |format| format.html… May 16, 2026 at 4:21 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a GridView in which each row has a custom view. The grid
A component I have created works fine if I put it in the main
friends, i have a page on which i am displaying image from gallery then
I have an RCP product which doesn't run. Then I installed Eclipse freshly, and
i want to write a text editor in java. i want it have a
Good evening everyone! I am working on learning some java and I have made
I have a Qt main window that will pop up a dialog box that
I have a Python script which uses Tkinter for the GUI. My little script
Here's the fact : I made a tiny app which consist of a table
I have a table named master with columns id , name , surname ,

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.