jsight
jsight

Reputation: 28409

How can I build a GWT Loading Dialog?

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?

Upvotes: 3

Views: 5091

Answers (2)

IgorM
IgorM

Reputation: 1068

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);
...
}

Upvotes: 7

Brian Deterling
Brian Deterling

Reputation: 13724

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.

Upvotes: 4

Related Questions