Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • mike.art1
    replied
    If you decide to declare the js files in the html make sure you use

    <inherits name="com.smartgwt.SmartGwtNoScript"/>

    in your module and in the html only include the js files you need. For example in your app these are not required.

    <script src=js/sc/modules/ISC_Forms.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_RichTextEditor.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_Calendar.js?isc_version=7.0beta.js></script>


    Also use yslow to find out the other bottle necks. I find that very useful

    Leave a comment:


  • mike.art1
    replied
    Nice app.
    Using gzip and expires header should reduce the load on the server. Assuming you are using apache webserver you can configure these directives.

    The loading screen is possible. Have a look at the showcase example.

    Code:
    <html>
    <head>
        <title>SmartGWT Showcase</title>
        <!--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>
        <link rel="stylesheet" href="Showcase.css">
        <link rel="stylesheet" href="css/CssStylesSample.css">
    </head>
    <body>
    <iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
    
    <!--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="images/loading.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>SmartGWT<br/>
            <span id="loadingMsg">Loading styles and images...</span></div>
    </div>
    </div>
        <script>var isomorphicDir = "js/sc/"</script>
    
    
    <script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading Core API...';</script>
    
    <!--include the SC Core API-->
    <script src=js/sc/modules/ISC_Core.js?isc_version=7.0beta.js></script>
    
    <!--include SmartClient -->
    <script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading UI Components...';</script>
    <script src=js/sc/modules/ISC_Foundation.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_Containers.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_Grids.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_Forms.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_RichTextEditor.js?isc_version=7.0beta.js></script>
    <script src=js/sc/modules/ISC_Calendar.js?isc_version=7.0beta.js></script>
    <script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading Data API...';</script>
    <script src=js/sc/modules/ISC_DataBinding.js?isc_version=7.0beta.js></script>
    
    <script>
    function readCookie(name) {
    	var nameEQ = name + "=";
    	var ca = document.cookie.split(';');
    	for(var i=0;i < ca.length;i++) {
    		var c = ca[i];
    		while (c.charAt(0)==' ') c = c.substring(1,c.length);
    		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    	}
    	return null;
    }
    
    // Determine what skin file to load
    var currentSkin = readCookie('skin'); 
    if (currentSkin == null) currentSkin = "SilverWave";
    </script>
    
    <!--load skin-->
    <script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading skin...';</script>
    
    <script type="text/javascript">
    document.write("<"+"script src=js/sc/skins/" + currentSkin + "/load_skin.js?isc_version=7.0beta.js><"+"/script>");
    </script>
    
    <!--include the application JS-->
    <script type="text/javascript">document.getElementById('loadingMsg').innerHTML = 'Loading ~250 Samples<br>Please wait...';</script>
    <script type="text/javascript" src="com.smartgwt.sample.showcase.Showcase.nocache.js"></script>
    
    
    </body>
    </html>

    Leave a comment:


  • sjardine
    replied
    The first thing I would do is make sure the content is getting compressed prior to sending. A basic gzip servlet filter is all you need.

    Leave a comment:


  • pbackx
    started a topic SmartGWT download speed

    SmartGWT download speed

    I have created a small application, but have now run into a major problem.

    To load the application, the browser needs to download about 3MB of data, which I think is a bit much for the few components I am using.

    Is there a way to decrease the download size?
    Can I have a loading screen (I noticed it is possible in the plain SmartClient library, but how to I do this in the GWT version?)

    btw, the application is at http://www.thecouchtv.com/cablepicker/

    Thanks a lot,
    Peter
Working...
X