Go Back   SmartClient Forums > Wishlist
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25th Oct 2011, 10:08
noschang@univali.br noschang@univali.br is offline
Registered Developer
 
Join Date: May 2010
Posts: 52
Default Resorce loading feature

It would be nice to have a feature for showing a progress screen and load scripts and/or other resources assynchronous on the fly.

Script resources could also be automatically appended to the document.

The idea is that all the resources including isomorphic API could be loaded before the application starts and the progress shown to the user.

Something like this:

Code:
<html>
    <head>
       <script src="./isomorphic/system/modules/ISC_ResourceLoader.js"></script>
       <script>
            window.onload = function() 
            {
                 var loader = isc.ResourceLoader.create
                      ({
                              showLoadingScreen : true,
                              autoInstallScripts : true,

                              resources : 
                              [
                                  { name : "license" url : "./license.txt", type : "plain_text"},
                                  { name : "isomorphic_core", url : "./isomorphic/system/modules/ISC_Core.js", type : "script"},
                                  { name : "validator", url : "./scripts/my_custom_validation.js", type : "script"}
                              ]

                              resourceLodaded : function (name, url, type, data, totalProgress)
                              { 
                                     if (name == "license")
                                        confirm(data);
                              },

                              onComplete : function()
                              {
                                    isc.Window.create
                                    ({
                                          width : 200, height : 150, autoCenter : true,
                                          items : 
                                          [
                                                 isc.Label.create({contents : "All files were loaded correctly!"});
                                          ]
                                    });
                              },
                            
                              onError : function(name, url, type, errorCode)
                              {
                                    if ((errorCode == 404) && (name == "isomorphic_core"))
                                   {
                                       alert("The isomorphic core API wasn't found! You can continue using this application but some features will not be available!");
                                   }
                              }
                      });
  
                      loader.start();
            }
       </script>
    </head>
    <body>
    </body>
</html>
Reply With Quote
  #2  
Old 25th Oct 2011, 10:16
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 38,396
Default

See FileLoader for SmartClient, and the .html file for loading the SmartGWT Showcase (which is a straight-to-the-browser progress indicator implementation).
Reply With Quote
  #3  
Old 9th Nov 2011, 08:31
noschang@univali.br noschang@univali.br is offline
Registered Developer
 
Join Date: May 2010
Posts: 52
Default

Thank you!
I'll take a look!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Launching Visual Builder in samples RevMen Smart GWT Technical Q&A 10 9th Sep 2011 10:05
Loading prompt of grid: modalmask on loading grid, center of prompt martintaal Technical Q&A 9 20th May 2011 05:58
ISC Feature Explorer: Sample "Mass Update" works in place; but NOT standalone SchlauKunde Technical Q&A 3 15th Apr 2011 16:53
loading indicator at the startup of ShowCase jasonzhang2002 Smart GWT Technical Q&A 5 29th May 2009 21:03
partial js loading catkeeper Smart GWT Technical Q&A 1 11th Jan 2009 05:47

© 2010,2011 Isomorphic Software. All Rights Reserved