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).
我有一个混合了HTML和GWT组件的页面。在内容完全加载之前,我不希望内容可供用户查看(可能在此过程中显示一个简单的加载对话框)。
What is the easiest way of achieving this?
实现这一目标的最简单方法是什么?
2 个解决方案
#1
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.
我使用PopupPanel,自动隐藏设置为false,模态设置为true。根据需要设置样式,在开始加载内容时显示,并在完成后隐藏它。
#2
Actually, the proposed way is to create a in your HTML and, after you load everything in your entry point, hide it:
实际上,建议的方法是在HTML中创建一个,并在加载入口点中的所有内容后隐藏它:
<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);
...
}
#1
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.
我使用PopupPanel,自动隐藏设置为false,模态设置为true。根据需要设置样式,在开始加载内容时显示,并在完成后隐藏它。
#2
Actually, the proposed way is to create a in your HTML and, after you load everything in your entry point, hide it:
实际上,建议的方法是在HTML中创建一个,并在加载入口点中的所有内容后隐藏它:
<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);
...
}