Smart gwt. How to determine when a download is complete

I am trying to write a progress bar or add a gif to load into a Smart Gwt application that starts with onModuleLoad and ends when the application is about to appear. Is there any type of event handler that can detect this? I looked, but found nothing.

+3
source share
1 answer

Noticed that no one answered this, looking for something else. If you look at the SmartGWT storefront, they will have a pop-up window displayed during application loading. In my application, I turned on the mechanism there, and you just need to add this to your webapp.html:

as part <head>

<!--CSS for loading message at application Startup-->
<style type="text/css">
    body { overflow:hidden }
    #loading {
        border: 1px solid #ccc;
        position: absolute;
        left: 45%;
        top: 40%;
        padding: 2px;
        z-index: 20001;
        height: auto;
    }

    #loading a {
        color: #225588;
    }

    #loading .loadingIndicator {
        background: white;
        font: bold 13px tahoma, arial, helvetica;
        padding: 10px;
        margin: 0;
        height: auto;
        color: #444;
    }

    #loadingMsg {
        font: normal 10px arial, tahoma, sans-serif;
    }
</style>

<body> script, WebApp.nocache.js:

<!--add loading indicator while the app is being loaded-->
<div id="loadingWrapper">
<div id="loading">
<div class="loadingIndicator">
    <!--<img src="images/pieces/48/cube_green.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>SmartGWT<br/>-->
    <img src="WebApp/sc/skins/EnterpriseBlue/images/loading.gif" width="16" height="16" style="margin-right:8px;float:left;vertical-align:top;"/>WebApp<br/>
    <span id="loadingMsg">Loading styles and images...</span></div>
    </div>
</div>

<!--load skin-->
<script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading skin...';</script>

<script type="text/javascript">
document.write("<"+"script src=WebApp/sc/skins/EnterpriseBlue/load_skin.js isc_version=7.1.js><"+"/script>");
</script>

<script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading Application<br>Please wait...';</script>
<!--include the application JS-->
+2

Source: https://habr.com/ru/post/1776500/


All Articles