tags:

views:

1246

answers:

2

I have a page with a mix of HTML and GWT components. I'd like to not make the content viewable to the user until the content has completely loading (perhaps showing a simple loading dialog during the process).

What is the easiest way of achieving this?

+3  A: 

I use a PopupPanel with autohide set to false and modal set to true. Style it however you want, show it when you start loading your content, and hide it when you're finished.

Brian Deterling
I had tried something like this and hit issues. But now I realize that I was just misusing the popup panel. I was adding it to RootPanel, which is unnecessary, and causes silent bad behavior. This approach does appear to be by far the best.
jsight
+3  A: 

Actually, the proposed way is to create a in your HTML and, after you load everything in your entry point, hide it:

<html>
...
<body>
...
    <div id="loading"> 
        <span id="loadingMsg">Loading ...</span>
    </div> 
...
</body>
</html>

public void onModuleLoad()
{
...
    // Hide the "Loading" notification
    RootPanel.get("loading").setVisible(false);
...
}
IgorM