huqi 5 лет назад
Родитель
Сommit
61d24bc60d

+ 1 - 1
o2web/source/o2_core/o2/o2.core.js

@@ -291,7 +291,7 @@
     //    /jaxrs\/script/ig,
     //    /jaxrs\/script/ig,
         /jaxrs\/script\/.+\/app\/.+\/imported/ig,
         /jaxrs\/script\/.+\/app\/.+\/imported/ig,
         /jaxrs\/script\/portal\/.+\/name\/.+\/imported/ig,
         /jaxrs\/script\/portal\/.+\/name\/.+\/imported/ig,
-        /jaxrs\/script\/.+\/application\/.+\/imported/ig,
+        /jaxrs\/script\/[\S\s]+\/application\/[\S\s]+\/imported/,
         /jaxrs\/page\/.+\/portal\/.+/ig
         /jaxrs\/page\/.+\/portal\/.+/ig
         // /jaxrs\/authentication/ig
         // /jaxrs\/authentication/ig
         // /jaxrs\/statement\/.*\/execute\/page\/.*\/size\/.*/ig
         // /jaxrs\/statement\/.*\/execute\/page\/.*\/size\/.*/ig

+ 130 - 11
o2web/source/o2_core/o2/xScript/CMSEnvironment.js

@@ -906,7 +906,24 @@ MWF.xScript.CMSEnvironment = function(ev){
         o[name] = {"value": fun, "configurable": over};
         o[name] = {"value": fun, "configurable": over};
         MWF.defineProperties(this, o);
         MWF.defineProperties(this, o);
     }.bind(this);
     }.bind(this);
-    
+    //如果前端事件有异步调用,想要在异步调用结束后继续运行页面加载,
+    //可在调用前执行 var resolve = this.wait();
+    //在异步调用结束后 执行 resolve.cb();
+    //目前只有表单的queryload事件支持此方法。
+    this.wait = function(){
+        resolve = {};
+        var setResolve = function(callback){
+            resolve.cb = callback;
+        }.bind(this);
+        this.target.event_resolve = setResolve;
+        return resolve;
+    };
+    //和this.wait配合使用,
+    //如果没有异步,则resolve.cb方法不存在,
+    //所以在回调中中使用this.goon();使表单继续加载
+    this.goon = function(){
+        this.target.event_resolve = null;
+    };
 
 
     //仅前台对象-----------------------------------------
     //仅前台对象-----------------------------------------
     //form
     //form
@@ -1511,10 +1528,10 @@ MWF.xScript.CMSJSONData = function(data, callback, key, parent){
 //        this.destory = this["delete"];
 //        this.destory = this["delete"];
 //    }
 //    }
 //};
 //};
-
-MWF.xScript.createCMSDict = function(application){
+var dictLoaded = {};
+MWF.xScript.createDict = function(application){
     //optionsOrName : {
     //optionsOrName : {
-    //  type : "", //默认为cms, 可以为  process  cms
+    //  type : "", //默认为process, 可以为  process  cms
     //  application : "", //流程/CMS的名称/别名/id, 默认为当前应用
     //  application : "", //流程/CMS的名称/别名/id, 默认为当前应用
     //  name : "", // 数据字典名称/别名/id
     //  name : "", // 数据字典名称/别名/id
     //  enableAnonymous : false //允许在未登录的情况下读取CMS的数据字典
     //  enableAnonymous : false //允许在未登录的情况下读取CMS的数据字典
@@ -1526,10 +1543,14 @@ MWF.xScript.createCMSDict = function(application){
             options = { name : options };
             options = { name : options };
         }
         }
         var name = this.name = options.name;
         var name = this.name = options.name;
-        var type = ( options.type && options.application ) ?  options.type : "cms";
+        var type = ( options.type && options.application ) ?  options.type : "process";
         var applicationId = options.application || application;
         var applicationId = options.application || application;
         var enableAnonymous = options.enableAnonymous || false;
         var enableAnonymous = options.enableAnonymous || false;
 
 
+        var key = name+type+applicationId+enableAnonymous
+        if (!dictLoaded[key]) dictLoaded[key] = {};
+        this.dictData = dictLoaded[key];
+
         //MWF.require("MWF.xScript.Actions.DictActions", null, false);
         //MWF.require("MWF.xScript.Actions.DictActions", null, false);
         if( type == "cms" ){
         if( type == "cms" ){
             var action = MWF.Actions.get("x_cms_assemble_control");
             var action = MWF.Actions.get("x_cms_assemble_control");
@@ -1545,24 +1566,35 @@ MWF.xScript.createCMSDict = function(application){
             return ar.join("/");
             return ar.join("/");
         };
         };
 
 
-        this.get = function(path, success, failure){
+        this.get = function(path, success, failure, async){
             var value = null;
             var value = null;
             if (path){
             if (path){
+                if (this.dictData[path]){
+                    if (success) success(this.dictData[path]);
+                    return this.dictData[path];
+                }
+
                 var p = encodePath( path );
                 var p = encodePath( path );
                 //var p = path.replace(/\./g, "/");
                 //var p = path.replace(/\./g, "/");
                 action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, function(json){
                 action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, function(json){
                     value = json.data;
                     value = json.data;
+                    this.dictData[path] = value;
                     if (success) success(json.data);
                     if (success) success(json.data);
-                }, function(xhr, text, error){
+                }.bind(this), function(xhr, text, error){
                     if (failure) failure(xhr, text, error);
                     if (failure) failure(xhr, text, error);
-                }, false, false);
+                }, !!async, false);
             }else{
             }else{
-                action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](encodeURIComponent(this.name), applicationId, function(json){
+                if (this.dictData["root"]){
+                    if (success) success(this.dictData["root"]);
+                    return this.dictData["root"];
+                }
+                action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, function(json){
                     value = json.data;
                     value = json.data;
+                    this.dictData["root"] = value;
                     if (success) success(json.data);
                     if (success) success(json.data);
-                }, function(xhr, text, error){
+                }.bind(this), function(xhr, text, error){
                     if (failure) failure(xhr, text, error);
                     if (failure) failure(xhr, text, error);
-                }, false);
+                }, !!async);
             }
             }
 
 
             return value;
             return value;
@@ -1599,3 +1631,90 @@ MWF.xScript.createCMSDict = function(application){
     }
     }
 };
 };
 
 
+// MWF.xScript.createCMSDict = function(application){
+//     //optionsOrName : {
+//     //  type : "", //默认为cms, 可以为  process  cms
+//     //  application : "", //流程/CMS的名称/别名/id, 默认为当前应用
+//     //  name : "", // 数据字典名称/别名/id
+//     //  enableAnonymous : false //允许在未登录的情况下读取CMS的数据字典
+//     //}
+//     //或者name: "" // 数据字典名称/别名/id
+//     return function(optionsOrName){
+//         var options = optionsOrName;
+//         if( typeOf( options ) == "string" ){
+//             options = { name : options };
+//         }
+//         var name = this.name = options.name;
+//         var type = ( options.type && options.application ) ?  options.type : "cms";
+//         var applicationId = options.application || application;
+//         var enableAnonymous = options.enableAnonymous || false;
+//
+//         //MWF.require("MWF.xScript.Actions.DictActions", null, false);
+//         if( type == "cms" ){
+//             var action = MWF.Actions.get("x_cms_assemble_control");
+//         }else{
+//             var action = MWF.Actions.get("x_processplatform_assemble_surface");
+//         }
+//
+//         var encodePath = function( path ){
+//             var arr = path.split(/\./g);
+//             var ar = arr.map(function(v){
+//                 return encodeURIComponent(v);
+//             });
+//             return ar.join("/");
+//         };
+//
+//         this.get = function(path, success, failure){
+//             var value = null;
+//             if (path){
+//                 var p = encodePath( path );
+//                 //var p = path.replace(/\./g, "/");
+//                 action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, function(json){
+//                     value = json.data;
+//                     if (success) success(json.data);
+//                 }, function(xhr, text, error){
+//                     if (failure) failure(xhr, text, error);
+//                 }, false, false);
+//             }else{
+//                 action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](encodeURIComponent(this.name), applicationId, function(json){
+//                     value = json.data;
+//                     if (success) success(json.data);
+//                 }, function(xhr, text, error){
+//                     if (failure) failure(xhr, text, error);
+//                 }, false);
+//             }
+//
+//             return value;
+//         };
+//
+//         this.set = function(path, value, success, failure){
+//             var p = encodePath( path );
+//             //var p = path.replace(/\./g, "/");
+//             action.setDictData(encodeURIComponent(this.name), applicationId, p, value, function(json){
+//                 if (success) success(json.data);
+//             }, function(xhr, text, error){
+//                 if (failure) failure(xhr, text, error);
+//             }, false, false);
+//         };
+//         this.add = function(path, value, success, failure){
+//             var p = encodePath( path );
+//             //var p = path.replace(/\./g, "/");
+//             action.addDictData(encodeURIComponent(this.name), applicationId, p, value, function(json){
+//                 if (success) success(json.data);
+//             }, function(xhr, text, error){
+//                 if (failure) failure(xhr, text, error);
+//             }, false, false);
+//         };
+//         this["delete"] = function(path, success, failure){
+//             var p = encodePath( path );
+//             //var p = path.replace(/\./g, "/");
+//             action.deleteDictData(encodeURIComponent(this.name), applicationId, p, function(json){
+//                 if (success) success(json.data);
+//             }, function(xhr, text, error){
+//                 if (failure) failure(xhr, text, error);
+//             }, false, false);
+//         };
+//         this.destory = this["delete"];
+//     }
+// };
+

+ 65 - 8
o2web/source/o2_core/o2/xScript/Environment.js

@@ -878,7 +878,7 @@ MWF.xScript.Environment = function(ev){
     //     var includedScripts = window.includedScripts;
     //     var includedScripts = window.includedScripts;
     // }
     // }
     var includedScripts = [];
     var includedScripts = [];
-    this.include = function( optionsOrName , callback ){
+    var _includeSingle = function( optionsOrName , callback, async){
         var options = optionsOrName;
         var options = optionsOrName;
         if( typeOf( options ) == "string" ){
         if( typeOf( options ) == "string" ){
             options = { name : options };
             options = { name : options };
@@ -922,6 +922,7 @@ MWF.xScript.Environment = function(ev){
                 }
                 }
                 break;
                 break;
         }
         }
+debugger;
         scriptAction.getScriptByName( application, name, includedScripts, function(json){
         scriptAction.getScriptByName( application, name, includedScripts, function(json){
             if (json.data){
             if (json.data){
                 includedScripts.push( key );
                 includedScripts.push( key );
@@ -931,7 +932,29 @@ MWF.xScript.Environment = function(ev){
             }else{
             }else{
                 if (callback) callback.apply(this);
                 if (callback) callback.apply(this);
             }
             }
-        }.bind(this), null, false);
+        }.bind(this), null, !!async);
+    }
+    this.include = function( optionsOrName , callback, async){
+        if (o2.typeOf(optionsOrName)=="array"){
+            if (!!async){
+                var count = optionsOrName.length;
+                var loaded = 0;
+                optionsOrName.each(function(option){
+                    _includeSingle.apply(this, [option, function(){
+                        loaded++;
+                        if (loaded>=count) if (callback) callback.apply(this);;
+                    }.bind(this), true]);
+                }.bind(this));
+
+            }else{
+                optionsOrName.each(function(option){
+                    _includeSingle.apply(this, [option]);
+                    if (callback) callback.apply(this);
+                }.bind(this));
+            }
+        }else{
+            _includeSingle.apply(this, [optionsOrName , callback, async])
+        }
     };
     };
 
 
     this.define = function(name, fun, overwrite){
     this.define = function(name, fun, overwrite){
@@ -942,6 +965,25 @@ MWF.xScript.Environment = function(ev){
         MWF.defineProperties(this, o);
         MWF.defineProperties(this, o);
     }.bind(this);
     }.bind(this);
 
 
+    //如果前端事件有异步调用,想要在异步调用结束后继续运行页面加载,
+    //可在调用前执行 var resolve = this.wait();
+    //在异步调用结束后 执行 resolve.cb();
+    //目前只有表单的queryload事件支持此方法。
+    this.wait = function(){
+        resolve = {};
+        var setResolve = function(callback){
+            resolve.cb = callback;
+        }.bind(this);
+        this.target.event_resolve = setResolve;
+        return resolve;
+    }
+    //和this.wait配合使用,
+    //如果没有异步,则resolve.cb方法不存在,
+    //所以在回调中中使用this.goon();使表单继续加载
+    this.goon = function(){
+        this.target.event_resolve = null;
+    }
+
 
 
     //仅前台对象-----------------------------------------
     //仅前台对象-----------------------------------------
     //form
     //form
@@ -1582,7 +1624,7 @@ MWF.xScript.JSONData = function(data, callback, key, parent, _form){
 //        this.destory = this["delete"];
 //        this.destory = this["delete"];
 //    }
 //    }
 //};
 //};
-
+var dictLoaded = {};
 MWF.xScript.createDict = function(application){
 MWF.xScript.createDict = function(application){
     //optionsOrName : {
     //optionsOrName : {
     //  type : "", //默认为process, 可以为  process  cms
     //  type : "", //默认为process, 可以为  process  cms
@@ -1601,6 +1643,10 @@ MWF.xScript.createDict = function(application){
         var applicationId = options.application || application;
         var applicationId = options.application || application;
         var enableAnonymous = options.enableAnonymous || false;
         var enableAnonymous = options.enableAnonymous || false;
 
 
+        var key = name+type+applicationId+enableAnonymous
+        if (!dictLoaded[key]) dictLoaded[key] = {};
+        this.dictData = dictLoaded[key];
+
         //MWF.require("MWF.xScript.Actions.DictActions", null, false);
         //MWF.require("MWF.xScript.Actions.DictActions", null, false);
         if( type == "cms" ){
         if( type == "cms" ){
             var action = MWF.Actions.get("x_cms_assemble_control");
             var action = MWF.Actions.get("x_cms_assemble_control");
@@ -1616,24 +1662,35 @@ MWF.xScript.createDict = function(application){
             return ar.join("/");
             return ar.join("/");
         };
         };
 
 
-        this.get = function(path, success, failure){
+        this.get = function(path, success, failure, async){
             var value = null;
             var value = null;
             if (path){
             if (path){
+                if (this.dictData[path]){
+                    if (success) success(this.dictData[path]);
+                    return this.dictData[path];
+                }
+
                 var p = encodePath( path );
                 var p = encodePath( path );
                 //var p = path.replace(/\./g, "/");
                 //var p = path.replace(/\./g, "/");
                 action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, function(json){
                 action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, function(json){
                     value = json.data;
                     value = json.data;
+                    this.dictData[path] = value;
                     if (success) success(json.data);
                     if (success) success(json.data);
-                }, function(xhr, text, error){
+                }.bind(this), function(xhr, text, error){
                     if (failure) failure(xhr, text, error);
                     if (failure) failure(xhr, text, error);
-                }, false, false);
+                }, !!async, false);
             }else{
             }else{
+                if (this.dictData["root"]){
+                    if (success) success(this.dictData["root"]);
+                    return this.dictData["root"];
+                }
                 action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, function(json){
                 action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, function(json){
                     value = json.data;
                     value = json.data;
+                    this.dictData["root"] = value;
                     if (success) success(json.data);
                     if (success) success(json.data);
-                }, function(xhr, text, error){
+                }.bind(this), function(xhr, text, error){
                     if (failure) failure(xhr, text, error);
                     if (failure) failure(xhr, text, error);
-                }, false);
+                }, !!async);
             }
             }
 
 
             return value;
             return value;

+ 18 - 0
o2web/source/o2_core/o2/xScript/PageEnvironment.js

@@ -840,6 +840,24 @@ MWF.xScript.PageEnvironment = function (ev) {
         MWF.defineProperties(this, o);
         MWF.defineProperties(this, o);
     }.bind(this);
     }.bind(this);
 
 
+    //如果前端事件有异步调用,想要在异步调用结束后继续运行页面加载,
+    //可在调用前执行 var resolve = this.wait();
+    //在异步调用结束后 执行 resolve.cb();
+    //目前只有表单的queryload事件支持此方法。
+    this.wait = function(){
+        resolve = {};
+        var setResolve = function(callback){
+            resolve.cb = callback;
+        }.bind(this);
+        this.target.event_resolve = setResolve;
+        return resolve;
+    };
+    //和this.wait配合使用,
+    //如果没有异步,则resolve.cb方法不存在,
+    //所以在回调中中使用this.goon();使表单继续加载
+    this.goon = function(){
+        this.target.event_resolve = null;
+    };
 
 
     //仅前台对象-----------------------------------------
     //仅前台对象-----------------------------------------
     //form
     //form

+ 3 - 3
o2web/source/x_component_process_Xform/Address.js

@@ -1,4 +1,4 @@
-MWF.require("MWF.widget.PinYin", null, false);
+//MWF.require("MWF.widget.PinYin", null, false);
 MWF.xDesktop.requireApp("process.Xform", "Combox", null, false);
 MWF.xDesktop.requireApp("process.Xform", "Combox", null, false);
 MWF.xApplication.process.Xform.Address = MWF.APPAddress =  new Class({
 MWF.xApplication.process.Xform.Address = MWF.APPAddress =  new Class({
 	Implements: [Events],
 	Implements: [Events],
@@ -28,7 +28,7 @@ MWF.xApplication.process.Xform.Address = MWF.APPAddress =  new Class({
     _loadNodeEdit: function(){
     _loadNodeEdit: function(){
         this.node.empty();
         this.node.empty();
 
 
-        MWF.require("MWF.widget.Combox", function(){
+        MWF.require(["MWF.widget.Combox","MWF.widget.PinYin"], function(){
             this.combox = new MWF.widget.Combox({
             this.combox = new MWF.widget.Combox({
                 "style": "blue",
                 "style": "blue",
                 "onlySelect": true,
                 "onlySelect": true,
@@ -185,4 +185,4 @@ MWF.xApplication.process.Xform.Address = MWF.APPAddress =  new Class({
                 if (callback) callback([]);
                 if (callback) callback([]);
         }
         }
     }
     }
-}); 
+}); 

+ 23 - 15
o2web/source/x_component_process_Xform/Form.js

@@ -1,4 +1,5 @@
-MWF.require(["MWF.widget.Common", "MWF.widget.Identity", "MWF.widget.O2Identity"], null, false);
+//MWF.require(["MWF.widget.Common", "MWF.widget.Identity", "MWF.widget.O2Identity"], null, false);
+MWF.require(["MWF.widget.Common", "MWF.widget.O2Identity"], null, false);
 MWF.xApplication.process = MWF.xApplication.process || {};
 MWF.xApplication.process = MWF.xApplication.process || {};
 MWF.xApplication.process.Xform = MWF.xApplication.process.Xform || {};
 MWF.xApplication.process.Xform = MWF.xApplication.process.Xform || {};
 MWF.xDesktop.requireApp("process.Xform", "lp." + MWF.language, null, false);
 MWF.xDesktop.requireApp("process.Xform", "lp." + MWF.language, null, false);
@@ -215,24 +216,31 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
 
 
                 this._loadEvents();
                 this._loadEvents();
 
 
-                if (this.fireEvent("queryLoad")) {
-
-                    if (this.lockDataPerson){
-                        var text = MWF.xApplication.process.Xform.LP.keyLockInfor;
-                        text = text.replace("{name}", o2.name.cn(this.lockDataPerson));
-                        var title = MWF.xApplication.process.Xform.LP.keyLockTitle;
-                        this.app.alert("info", "center", title, text, 400, 160);
-                    }
-
-                    if (this.app) if (this.app.fireEvent) this.app.fireEvent("queryLoad");
-                    this._loadBusinessData();
-                    this.fireEvent("beforeLoad");
-                    if (this.app) if (this.app.fireEvent) this.app.fireEvent("beforeLoad");
-                    this.loadContent(callback);
+                this.fireEvent("queryLoad");
+                if (this.event_resolve){
+                    this.event_resolve(function(){
+                        this.loadForm(callback)
+                    }.bind(this));
+                }else{
+                    this.loadForm(callback);
                 }
                 }
             }.bind(this));
             }.bind(this));
         }.bind(this))
         }.bind(this))
     },
     },
+    loadForm: function(callback){
+        if (this.lockDataPerson){
+            var text = MWF.xApplication.process.Xform.LP.keyLockInfor;
+            text = text.replace("{name}", o2.name.cn(this.lockDataPerson));
+            var title = MWF.xApplication.process.Xform.LP.keyLockTitle;
+            this.app.alert("info", "center", title, text, 400, 160);
+        }
+
+        if (this.app) if (this.app.fireEvent) this.app.fireEvent("queryLoad");
+        this._loadBusinessData();
+        this.fireEvent("beforeLoad");
+        if (this.app) if (this.app.fireEvent) this.app.fireEvent("beforeLoad");
+        this.loadContent(callback);
+    },
     loadExtendStyle: function (callback) {
     loadExtendStyle: function (callback) {
         if (!this.json.styleConfig || !this.json.styleConfig.extendFile) {
         if (!this.json.styleConfig || !this.json.styleConfig.extendFile) {
             if (callback) callback();
             if (callback) callback();

+ 2 - 2
o2web/source/x_component_process_Xform/Sidebar.js

@@ -1,5 +1,5 @@
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
-MWF.require("MWF.widget.Tree", null, false);
+//MWF.require("MWF.widget.Tree", null, false);
 MWF.xApplication.process.Xform.Sidebar = MWF.APPSidebar =  new Class({
 MWF.xApplication.process.Xform.Sidebar = MWF.APPSidebar =  new Class({
 	Extends: MWF.APP$Module,
 	Extends: MWF.APP$Module,
 
 
@@ -338,4 +338,4 @@ MWF.xApplication.process.Xform.Sidebar = MWF.APPSidebar =  new Class({
     printWork: function(){
     printWork: function(){
         this.form.printWork();
         this.form.printWork();
     }
     }
-}); 
+}); 

+ 1 - 1
o2web/source/x_component_process_Xform/Tab.js

@@ -96,4 +96,4 @@ MWF.xApplication.process.Xform.tab$Content = MWF.APPTab$Content =  new Class({
     _loadUserInterface: function(){
     _loadUserInterface: function(){
         this.form._loadModules(this.node);
         this.form._loadModules(this.node);
     }
     }
-});
+});

+ 10 - 8
o2web/source/x_component_process_Xform/Tree.js

@@ -1,20 +1,22 @@
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
-MWF.require("MWF.widget.Tree", null, false);
 MWF.xApplication.process.Xform.Tree = MWF.APPTree =  new Class({
 MWF.xApplication.process.Xform.Tree = MWF.APPTree =  new Class({
 	Extends: MWF.APP$Module,
 	Extends: MWF.APP$Module,
 
 
 	_loadUserInterface: function(){
 	_loadUserInterface: function(){
 		this.node.empty();
 		this.node.empty();
-		this.tree = new MWF.widget.Tree(this.node, {"style":"form"});
-        this.tree.form = this.form;
 
 
-		this._setTreeWidgetStyles();
+		MWF.require("MWF.widget.Tree", function(){
+			this.tree = new MWF.widget.Tree(this.node, {"style":"form"});
+			this.tree.form = this.form;
 
 
+			this._setTreeWidgetStyles();
 
 
-        var treeData = this.json.data;
-        if (this.json.dataType == "script") treeData = this.form.Macro.exec(((this.json.dataScript) ? this.json.dataScript.code : ""), this);
 
 
-		this.tree.load(treeData);
+			var treeData = this.json.data;
+			if (this.json.dataType == "script") treeData = this.form.Macro.exec(((this.json.dataScript) ? this.json.dataScript.code : ""), this);
+
+			this.tree.load(treeData);
+		}.bind(this));
 	},
 	},
 	_setTreeWidgetStyles: function(){
 	_setTreeWidgetStyles: function(){
 		this.tree.css.areaNode = this.json.areaNodeStyle;
 		this.tree.css.areaNode = this.json.areaNodeStyle;
@@ -22,4 +24,4 @@ MWF.xApplication.process.Xform.Tree = MWF.APPTree =  new Class({
 		this.tree.css.textDivNode = this.json.textDivNodeStyle;
 		this.tree.css.textDivNode = this.json.textDivNodeStyle;
 		this.tree.css.textDivNodeSelected = this.json.textDivNodeSelectedStyle;
 		this.tree.css.textDivNodeSelected = this.json.textDivNodeSelectedStyle;
 	}
 	}
-}); 
+}); 

+ 2 - 2
o2web/source/x_component_process_Xform/View.js

@@ -1,5 +1,4 @@
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
 MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
-MWF.xDesktop.requireApp("query.Query", "Viewer", null, false);
 //MWF.xDesktop.requireApp("process.Xform", "widget.View", null, false);
 //MWF.xDesktop.requireApp("process.Xform", "widget.View", null, false);
 MWF.xApplication.process.Xform.View = MWF.APPView =  new Class({
 MWF.xApplication.process.Xform.View = MWF.APPView =  new Class({
 	Extends: MWF.APP$Module,
 	Extends: MWF.APP$Module,
@@ -8,6 +7,7 @@ MWF.xApplication.process.Xform.View = MWF.APPView =  new Class({
     },
     },
 
 
     _loadUserInterface: function(){
     _loadUserInterface: function(){
+        MWF.xDesktop.requireApp("query.Query", "Viewer", null, false);
         this.node.empty();
         this.node.empty();
     },
     },
     _afterLoaded: function(){
     _afterLoaded: function(){
@@ -163,4 +163,4 @@ MWF.xApplication.process.Xform.View = MWF.APPView =  new Class({
             return [];
             return [];
         }
         }
     }
     }
-});
+});

+ 1 - 1
o2web/source/x_desktop/workmobile.html

@@ -20,7 +20,7 @@
         <title>WORK</title>
         <title>WORK</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     </head>
     </head>
-    <body style="overflow: hidden; margin:0px;">
+    <body style="overflow: hidden; margin:0px;background:url(../o2_core/o2/xDesktop/$Default/blue/icons/loading.gif) center no-repeat;">
         <div style="-webkit-overflow-scrolling: touch; overflow: auto; height: 100%;">
         <div style="-webkit-overflow-scrolling: touch; overflow: auto; height: 100%;">
             <div id="loaddingArea" style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 100"></div>
             <div id="loaddingArea" style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 100"></div>
             <div id="layout" style="overflow: hidden; -webkit-transform: translateZ(0); "></div>
             <div id="layout" style="overflow: hidden; -webkit-transform: translateZ(0); "></div>