-2

i used that code on a gxt application, to have a loading fragment item:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <link type="text/css" rel="stylesheet" href="gxt/css/gxt-all.css" />
    <link type="text/css" rel="stylesheet" href="MyApp.css">
    <title>MyApp</title>    
  </head>
  <body>
<style>
#loading {
position: absolute; left: 45%; top: 40%; padding: 2px;   
margin-left:-45px; z-index:20001; border:1px solid #ccc;
}
#loading .loading-indicator {
background:#eef;font:bold 13px tahoma,arial,helvetica;
padding:10px;margin:0;height:auto;color:#444; 
}
#loading .loading-indicator img {
margin-right:8px; float:left; vertical-align:top;
}
#loading-msg {font:normal 10px arial,tahoma,sans-serif;}
</style>
<div id="loading">
<div class="loading-indicator">
<img src="gxt/images/default/shared/large-loading.gif"/>
myCustomerContacts<br />
<span id="loading-msg">Loading application...</span>
</div>
</div>
    <script type="text/javascript" language="javascript" src="myapp/myapp.nocache.js"></script>
  </body>

</html>

why the loading, why doesn't the Loading fragment stop when the application loaded?

Adi Mor
  • 2,145
  • 5
  • 25
  • 44

1 Answers1

0

After your application is loaded you need to remove the loading div from the DOM.

This can be done like this:

 DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById("loading"));

Here is a good sum up by David Chandler from the GWT Team on what your are trying to do: http://turbomanage.wordpress.com/2009/10/13/how-to-create-a-splash-screen-while-gwt-loads/

Daniel Kurka
  • 7,973
  • 2
  • 24
  • 43