فهرست منبع

修改表单载入机制,加快速度

huqi 5 سال پیش
والد
کامیت
7e6df3025d
66فایلهای تغییر یافته به همراه1054 افزوده شده و 1388 حذف شده
  1. 1 1
      o2web/source/x_component_cms_FormDesigner/Module/Form.js
  2. 8 8
      o2web/source/x_component_process_FormDesigner/Main.js
  3. 8 2
      o2web/source/x_component_process_FormDesigner/Module/$Container.js
  4. 272 0
      o2web/source/x_component_process_FormDesigner/Module/$Input.js
  5. 23 0
      o2web/source/x_component_process_FormDesigner/Module/$Module.js
  6. 2 43
      o2web/source/x_component_process_FormDesigner/Module/Address.js
  7. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Address/default/css.wcss
  8. 0 2
      o2web/source/x_component_process_FormDesigner/Module/Button.js
  9. 4 70
      o2web/source/x_component_process_FormDesigner/Module/Calendar.js
  10. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Calendar/default/css.wcss
  11. 35 71
      o2web/source/x_component_process_FormDesigner/Module/Checkbox.js
  12. 3 2
      o2web/source/x_component_process_FormDesigner/Module/Checkbox/checkbox.html
  13. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Checkbox/default/css.wcss
  14. 34 121
      o2web/source/x_component_process_FormDesigner/Module/Combox.js
  15. 0 1
      o2web/source/x_component_process_FormDesigner/Module/Combox/combox.html
  16. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Combox/default/css.wcss
  17. 21 0
      o2web/source/x_component_process_FormDesigner/Module/Datagrid$Data.js
  18. 61 9
      o2web/source/x_component_process_FormDesigner/Module/Form.js
  19. 2 82
      o2web/source/x_component_process_FormDesigner/Module/Number.js
  20. 5 98
      o2web/source/x_component_process_FormDesigner/Module/Opinion.js
  21. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Opinion/default/css.wcss
  22. 5 96
      o2web/source/x_component_process_FormDesigner/Module/Org.js
  23. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Org/default/css.wcss
  24. 5 96
      o2web/source/x_component_process_FormDesigner/Module/Orgfield.js
  25. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Orgfield/default/css.wcss
  26. 58 90
      o2web/source/x_component_process_FormDesigner/Module/Personfield.js
  27. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Personfield/default/css.wcss
  28. 4 76
      o2web/source/x_component_process_FormDesigner/Module/Radio.js
  29. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Radio/default/css.wcss
  30. 42 113
      o2web/source/x_component_process_FormDesigner/Module/Select.js
  31. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Select/default/css.wcss
  32. 21 0
      o2web/source/x_component_process_FormDesigner/Module/Tab$Content.js
  33. 21 0
      o2web/source/x_component_process_FormDesigner/Module/Tab$Page.js
  34. 22 1
      o2web/source/x_component_process_FormDesigner/Module/Tab.js
  35. 38 3
      o2web/source/x_component_process_FormDesigner/Module/Table$Td.js
  36. 58 91
      o2web/source/x_component_process_FormDesigner/Module/Textarea.js
  37. 1 1
      o2web/source/x_component_process_FormDesigner/Module/Textarea/default/css.wcss
  38. 4 115
      o2web/source/x_component_process_FormDesigner/Module/Textfield.js
  39. 14 10
      o2web/source/x_component_process_Xform/$Input.js
  40. 1 1
      o2web/source/x_component_process_Xform/$Module.js
  41. 10 8
      o2web/source/x_component_process_Xform/Checkbox.js
  42. 3 3
      o2web/source/x_component_process_Xform/Combox.js
  43. 2 2
      o2web/source/x_component_process_Xform/DatagridMobile.js
  44. 2 2
      o2web/source/x_component_process_Xform/DatagridPC.js
  45. 2 2
      o2web/source/x_component_process_Xform/Form.js
  46. 1 1
      o2web/source/x_component_process_Xform/Iframe.js
  47. 2 2
      o2web/source/x_component_process_Xform/ImageClipper.js
  48. 1 1
      o2web/source/x_component_process_Xform/Label.js
  49. 7 7
      o2web/source/x_component_process_Xform/Log.js
  50. 15 8
      o2web/source/x_component_process_Xform/Number.js
  51. 2 1
      o2web/source/x_component_process_Xform/Office.js
  52. 18 11
      o2web/source/x_component_process_Xform/Opinion.js
  53. 26 18
      o2web/source/x_component_process_Xform/Org.js
  54. 36 28
      o2web/source/x_component_process_Xform/Orgfield.js
  55. 25 20
      o2web/source/x_component_process_Xform/Personfield.js
  56. 9 6
      o2web/source/x_component_process_Xform/Radio.js
  57. 9 4
      o2web/source/x_component_process_Xform/Select.js
  58. 1 0
      o2web/source/x_component_process_Xform/Source.js
  59. 17 15
      o2web/source/x_component_process_Xform/Stat.js
  60. 3 3
      o2web/source/x_component_process_Xform/Subform.js
  61. 2 2
      o2web/source/x_component_process_Xform/Subpage.js
  62. 43 6
      o2web/source/x_component_process_Xform/Table.js
  63. 18 14
      o2web/source/x_component_process_Xform/Textarea.js
  64. 14 8
      o2web/source/x_component_process_Xform/Textfield.js
  65. 1 1
      o2web/source/x_component_process_Xform/Tree.js
  66. 2 2
      o2web/source/x_component_process_Xform/Widget.js

+ 1 - 1
o2web/source/x_component_cms_FormDesigner/Module/Form.js

@@ -193,7 +193,7 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
 			if (callback) callback(this.dataTemplate[className]);
 		}else{
 			var path = MWF.CMSFD.ResetTemplateModules.indexOf( className.toLowerCase() ) != -1 ? "x_component_cms_FormDesigner" : "x_component_process_FormDesigner";
-			var templateUrl = "/"+path+"/Module/"+className+"/template.json";
+			var templateUrl = "../"+path+"/Module/"+className+"/template.json";
 			MWF.getJSON(templateUrl, function(responseJSON, responseText){
 				this.dataTemplate[className] = responseJSON;
 				if (callback) callback(responseJSON);

+ 8 - 8
o2web/source/x_component_process_FormDesigner/Main.js

@@ -1501,12 +1501,12 @@ MWF.xApplication.process.FormDesigner.Main = new Class({
 
             var pcData, mobileData;
             if (this.pcForm){
-                this.pcForm._getFormData();
-                pcData = this.pcForm.data;
+                pcData = this.pcForm._getFormData();
+                //pcData = this.pcForm.data;
             }
             if (this.mobileForm){
-                this.mobileForm._getFormData();
-                mobileData = this.mobileForm.data;
+                mobileData = this.mobileForm._getFormData();
+                //mobileData = this.mobileForm.data;
             }else{
                 if (this.formMobileData) mobileData = this.formMobileData;
             }
@@ -1668,12 +1668,12 @@ MWF.xApplication.process.FormDesigner.Main = new Class({
     saveTemplate: function(markNode, areaNode, iconNode, nameNode, categorySelect, newCategoryNode, descriptionNode){
         var pcData, mobileData;
         if (this.pcForm){
-            this.pcForm._getFormData();
-            pcData = this.pcForm.data;
+            pcData = this.pcForm._getFormData();
+            //pcData = this.pcForm.data;
         }
         if (this.mobileForm){
-            this.mobileForm._getFormData();
-            mobileData = this.mobileForm.data;
+            mobileData = this.mobileForm._getFormData();
+            //mobileData = this.mobileForm.data;
         }
 
         var name = nameNode.get("value");

+ 8 - 2
o2web/source/x_component_process_FormDesigner/Module/$Container.js

@@ -142,14 +142,20 @@ MWF.xApplication.process.FormDesigner.Module.$Container = MWF.FC$Container = new
         this.json.moduleName = this.moduleName;
     },
 	parseModules: function(){
+		var moduleNodes = [];
 		var subDom = this.node.getFirst();
 		while (subDom){
 			if (subDom.get("MWFtype")){
-				var json = this.form.getDomjson(subDom);
-				module = this.form.loadModule(json, subDom, this);
+				let json = this.form.getDomjson(subDom);
+				let moduleNode = subDom;
+				moduleNodes.push({"dom": moduleNode, "json": json});
+				//module = this.form.loadModule(json, subDom, this);
 			}
 			subDom = subDom.getNext();
 		}
+		moduleNodes.each(function(obj){
+			module = this.form.loadModule(obj.json, obj.dom, this);
+		}.bind(this));
 	},
 	destroy: function(){
 		var modules = this._getSubModule();

+ 272 - 0
o2web/source/x_component_process_FormDesigner/Module/$Input.js

@@ -0,0 +1,272 @@
+MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xApplication.process.FormDesigner.Module.$Input = MWF.FC$Input = new Class({
+    Extends: MWF.FC$Element,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+        "type": "textfield",
+        "path": "../x_component_process_FormDesigner/Module/Textfield/",
+        "propertyPath": "../x_component_process_FormDesigner/Module/Textfield/textfield.html"
+    },
+
+    initialize: function(form, options){
+        this.setOptions(options);
+
+        this.path = this.options.path;
+        this.cssPath = this.path+this.options.style+"/css.wcss";
+
+        this._loadCss();
+        this.moduleType = "element";
+        this.moduleName = this.options.type;
+
+        this.form = form;
+        this.container = null;
+        this.containerNode = null;
+    },
+    clearTemplateStyles: function(styles){
+        if (styles){
+            if (styles.styles) this.removeStyles(styles.styles, "styles");
+            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
+            if (styles.properties) this.removeStyles(styles.properties, "properties");
+        }
+    },
+    setTemplateStyles: function(styles){
+        if (styles.styles) this.copyStyles(styles.styles, "styles");
+        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
+        if (styles.properties) this.copyStyles(styles.properties, "properties");
+    },
+
+    _resetModuleDomNode: function(){
+        if (this.json.preprocessing){
+            this.node.empty();
+            var icon = new Element("div", {
+                "styles": this.css.textfieldIcon
+            }).inject(this.node);
+            var text = new Element("div", {
+                "styles": this.css.moduleText,
+                "text": this.json.id
+            }).inject(this.node);
+        }
+    },
+
+    _createMoveNode: function(){
+        this.moveNode = new Element("div", {
+            "MWFType": "textfield",
+            "id": this.json.id,
+            "styles": this.css.moduleNodeMove,
+            "events": {
+                "selectstart": function(){
+                    return false;
+                }
+            }
+        }).inject(this.form.container);
+
+        var icon = new Element("div", {
+            "styles": this.css.textfieldIcon
+        }).inject(this.moveNode);
+        var text = new Element("div", {
+            "styles": this.css.moduleText,
+            "text": this.json.id
+        }).inject(this.moveNode);
+    },
+    setPropertiesOrStyles: function(name){
+        if (name=="styles"){
+            // if (this.parentContainer){
+            //     if (this.parentContainer.moduleName == "datagrid$Data"){
+            //         //if (!this.json.styles.width) this.json.styles.width = "90%";
+            //     }
+            // }
+            try{
+                this.setCustomStyles();
+            }catch(e){}
+            //this.setCustomStyles();
+        }
+        if (name=="inputStyles"){
+            try{
+                this.setCustomInputStyles();
+            }catch(e){}
+            //
+            // var text = this.node.getLast("div");
+            // text.clearStyles();
+            // text.setStyles(this.css.moduleText);
+            //
+            // Object.each(this.json.inputStyles, function(value, key){
+            //     var reg = /^border\w*/ig;
+            //     if (!key.test(reg)){
+            //         text.setStyle(key, value);
+            //     }
+            // }.bind(this));
+        }
+        if (name=="properties"){
+            this.node.setProperties(this.json.properties);
+        }
+    },
+
+    _loadNodeStyles: function(){
+        var icon = this.node.getFirst("div");
+        var text = this.node.getLast("div");
+        if (!icon) icon = new Element("div").inject(this.node, "top");
+        if (!text) text = new Element("div").inject(this.node, "bottom");
+        icon.setStyles(this.css.textfieldIcon);
+        text.setStyles(this.css.moduleText);
+    },
+    _getCopyNode: function(){
+        if (!this.copyNode) this._createCopyNode();
+        this.copyNode.setStyle("display", "inline-block");
+        return this.copyNode;
+    },
+
+    _setEditStyle_custom: function(name){
+        if (name=="id"){
+            this.node.getLast().set("text", this.json.id);
+        }
+    },
+    _preprocessingModuleData: function(){
+        this.node.clearStyles();
+        this.recoveryIconNode = this.node.getFirst();
+        this.recoveryIconNode.dispose();
+        this.recoveryTextNode = this.node.getFirst();
+        this.recoveryTextNode.dispose();
+
+        var inputNode = new Element("input", {
+            "styles": {
+                "background": "transparent",
+                "width": "100%",
+                "border": "0px"
+            }
+        }).inject(this.node);
+        this.node.setStyles({
+            "overflow": "hidden",
+            "position": "relative",
+            "margin-right": "20px",
+            "padding-right": "4px"
+        })
+
+        if (this.json.styles){
+            this.json.recoveryStyles = Object.clone(this.json.styles);
+            if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+                if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+                    this.node.setStyle(key, value);
+                    delete this.json.styles[key];
+                }
+            }.bind(this));
+        }
+        if (this.json.inputStyles){
+            this.json.recoveryInputStyles = Object.clone(this.json.inputStyles);
+            var inputNode = this.node.getFirst();
+            if (inputNode){
+                if (this.json.recoveryInputStyles) Object.each(this.json.recoveryInputStyles, function(value, key){
+                    if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+                        inputNode.setStyle(key, value);
+                        delete this.json.inputStyles[key];
+                    }
+                }.bind(this));
+            }
+        }
+        this.json.preprocessing = "y";
+    },
+    _recoveryModuleData: function(){
+        if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+        if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
+
+        if (this.recoveryTextNode) {
+            this.node.empty();
+            this.recoveryTextNode.inject(this.node, "top");
+        }
+        if (this.recoveryIconNode) {
+            this.recoveryIconNode.inject(this.node, "top");
+        }
+
+        this.json.recoveryStyles = null;
+        this.json.recoveryInputStyles = null;
+        this.recoveryIconNode = null;
+        this.recoveryTextNode = null;
+    },
+
+    setCustomStyles: function(){
+        this._recoveryModuleData();
+        //debugger;
+        var border = this.node.getStyle("border");
+        this.node.clearStyles();
+        this.node.setStyles(this.css.moduleNode);
+
+        if (this.initialStyles) this.node.setStyles(this.initialStyles);
+        this.node.setStyle("border", border);
+
+        if (this.json.styles) Object.each(this.json.styles, function(value, key){
+            if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }
+                if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                    value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                    value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+            }
+
+            var reg = /^border\w*/ig;
+            if (!key.test(reg)){
+                if (key){
+                    if (key.toString().toLowerCase()==="display"){
+                        if (value.toString().toLowerCase()==="none"){
+                            this.node.setStyle("opacity", 0.3);
+                        }else{
+                            this.node.setStyle("opacity", 1);
+                            this.node.setStyle(key, value);
+                        }
+                    }else{
+                        this.node.setStyle(key, value);
+                    }
+                }
+            }
+        }.bind(this));
+    },
+    setCustomInputStyles: function(){
+        this._recoveryModuleData();
+
+        var inputNode = this.node.getLast();
+        if (inputNode){
+            inputNode.clearStyles();
+            inputNode.setStyles(this.css.moduleText);
+
+            if (this.json.inputStyles) Object.each(this.json.inputStyles, function(value, key){
+                if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+                    var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                    var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                    if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                        value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                    }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                        value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                    }
+                    if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                        value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                    }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                        value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                    }
+                }
+
+                var reg = /^border\w*/ig;
+                if (!key.test(reg)){
+                    if (key){
+                        if (key.toString().toLowerCase()==="display"){
+                            if (value.toString().toLowerCase()==="none"){
+                                inputNode.setStyle("opacity", 0.3);
+                            }else{
+                                inputNode.setStyle("opacity", 1);
+                                inputNode.setStyle(key, value);
+                            }
+                        }else{
+                            inputNode.setStyle(key, value);
+                        }
+                    }
+                }
+            }.bind(this));
+        }
+    }
+});

+ 23 - 0
o2web/source/x_component_process_FormDesigner/Module/$Module.js

@@ -182,6 +182,8 @@ MWF.xApplication.process.FormDesigner.Module.$Module = MWF.FC$Module = new Class
 	_initModule: function(){
 		if (!this.json.isSaved) this.setStyleTemplate();
 
+		this._resetModuleDomNode();
+
 		this.setPropertiesOrStyles("styles");
 		this.setPropertiesOrStyles("inputStyles");
 		this.setPropertiesOrStyles("properties");
@@ -191,6 +193,7 @@ MWF.xApplication.process.FormDesigner.Module.$Module = MWF.FC$Module = new Class
 		this._setNodeEvent();
 		this.json.isSaved = true;
 	},
+	_resetModuleDomNode: function(){},
 	_setNodeProperty: function(){},
 
 	_createIconAction: function(){
@@ -942,7 +945,27 @@ MWF.xApplication.process.FormDesigner.Module.$Module = MWF.FC$Module = new Class
 			}
 		}.bind(this));
 	},
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		//if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+	},
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		this.json.recoveryStyles = null;
+	},
 	setCustomStyles: function(){
+		this._recoveryModuleData();
+		//debugger;
 		var border = this.node.getStyle("border");
 		this.node.clearStyles();
 		this.node.setStyles(this.css.moduleNode);

+ 2 - 43
o2web/source/x_component_process_FormDesigner/Module/Address.js

@@ -5,49 +5,8 @@ MWF.xApplication.process.FormDesigner.Module.Address = MWF.FCAddress = new Class
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "address",
+		"path": "../x_component_process_FormDesigner/Module/Address/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Address/address.html"
-	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Address/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Address/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "address";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    _loadNodeStyles: function(){
-        var icon = this.node.getFirst("div");
-        var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-        icon.setStyles(this.css.addressIcon);
-        text.setStyles(this.css.moduleText);
-    },
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "address",
-			"styles": this.css.moduleNodeMove,
-			"id": this.json.id,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.addressIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
 	}
-	
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Address/default/css.wcss

@@ -47,7 +47,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"addressIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Address/default/icon/addr.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 0 - 2
o2web/source/x_component_process_FormDesigner/Module/Button.js

@@ -95,6 +95,4 @@ MWF.xApplication.process.FormDesigner.Module.Button = MWF.FCButton = new Class({
 			}
 		}
 	}
-
-	
 });

+ 4 - 70
o2web/source/x_component_process_FormDesigner/Module/Calendar.js

@@ -1,78 +1,12 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Calendar = MWF.FCCalendar = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "calendar",
+		"path": "../x_component_process_FormDesigner/Module/Calendar/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Calendar/calendar.html"
-	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Calendar/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Calendar/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "calendar";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "calendar",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-		
-		var icon = new Element("div", {
-			"styles": this.css.personfieldIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.personfieldIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
 	}
-
-	
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Calendar/default/css.wcss

@@ -48,7 +48,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"personfieldIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Calendar/default/icon/calendar.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 35 - 71
o2web/source/x_component_process_FormDesigner/Module/Checkbox.js

@@ -1,84 +1,48 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Checkbox = MWF.FCCheckbox = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "checkbox",
+		"path": "../x_component_process_FormDesigner/Module/Checkbox/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Checkbox/checkbox.html"
 	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Checkbox/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Checkbox/"+this.options.style+"/css.wcss";
 
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "checkbox";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-	
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "checkbox",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		this.recoveryIconNode = this.node.getFirst();
+		this.recoveryIconNode.dispose();
+		this.recoveryTextNode = this.node.getFirst();
+		this.recoveryTextNode.dispose();
+
+		if (this.json.styles){
+			this.json.recoveryStyles = Object.clone(this.json.styles);
+			if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+				if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+					this.node.setStyle(key, value);
+					delete this.json.styles[key];
 				}
-			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.checkboxIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.checkboxIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	unSelected: function(){
-		this.node.setStyles({
-			"border-width": "1px",
-			"border-color": "#999"
-		});
-		if (this.actionArea) this.actionArea.setStyle("display", "none");
-		this.form.currentSelectedModule = null;
-		
-		this.hideProperty();
-	},
-	unOver: function(){
-		if (!this.form.moveModule) if (this.form.currentSelectedModule!=this) this.node.setStyles({
-			"border-width": "1px",
-			"border-color": "#999"
-		});
+			}.bind(this));
+		}
+		this.json.preprocessing = "y";
 	},
-	
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
+
+		if (this.recoveryTextNode) {
+			this.node.empty();
+			this.recoveryTextNode.inject(this.node, "top");
+		}
+		if (this.recoveryIconNode) {
+			this.recoveryIconNode.inject(this.node, "top");
 		}
-	}
 
-	
+		this.json.recoveryStyles = null;
+		this.json.recoveryInputStyles = null;
+		this.recoveryIconNode = null;
+		this.recoveryTextNode = null;
+	},
 });

+ 3 - 2
o2web/source/x_component_process_FormDesigner/Module/Checkbox/checkbox.html

@@ -31,8 +31,9 @@
 		
 		<div id="text{$.pid}selectEditItemValues" style="display: text{($.itemType=='values')?'block':'none'}" class="MWFArraylist" name="itemValues" title="可选值"></div>
 		<div id="text{$.pid}selectEditItemScript" style="display: text{($.itemType=='script')?'block':'none'}" class="MWFScriptArea" name="itemScript" title="可选值脚本 (S)"></div>
-		
-		<div class="MWFMaplist" name="styles" title="样式"></div>
+
+        <div class="MWFMaplist" name="styles" title="容器样式"></div>
+        <div class="MWFMaplist" name="buttonStyles" title="按钮样式"></div>
 		<div class="MWFMaplist" name="properties" title="属性"></div>
 
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Checkbox/default/css.wcss

@@ -47,7 +47,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"checkboxIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Checkbox/default/icon/check.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 34 - 121
o2web/source/x_component_process_FormDesigner/Module/Combox.js

@@ -1,134 +1,47 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Combox = MWF.FCCombox = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+        "type": "combox",
+        "path": "../x_component_process_FormDesigner/Module/Combox/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Combox/combox.html"
 	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Combox/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Combox/"+this.options.style+"/css.wcss";
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		this.recoveryIconNode = this.node.getFirst();
+		this.recoveryIconNode.dispose();
+		this.recoveryTextNode = this.node.getFirst();
+		this.recoveryTextNode.dispose();
 
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "combox";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-	
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "combox",
-			"styles": this.css.moduleNodeMove,
-			"id": this.json.id,
-			"events": {
-				"selectstart": function(){
-					return false;
+		if (this.json.styles){
+			this.json.recoveryStyles = Object.clone(this.json.styles);
+			if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+				if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+					this.node.setStyle(key, value);
+					delete this.json.styles[key];
 				}
-			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.selectIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.selectIcon);
-		text.setStyles(this.css.moduleText);
+			}.bind(this));
+		}
+		this.json.preprocessing = "y";
 	},
-	
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
 
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
+		if (this.recoveryTextNode) {
+			this.node.empty();
+			this.recoveryTextNode.inject(this.node, "top");
+		}
+		if (this.recoveryIconNode) {
+			this.recoveryIconNode.inject(this.node, "top");
+		}
 
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    },
-
-    _setEditStyle_custom: function(name){
-        if (name=="id"){
-            this.node.getLast().set("text", this.json.id);
-        }
-    },
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
-
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    }
-	
+		this.json.recoveryStyles = null;
+		this.json.recoveryInputStyles = null;
+		this.recoveryIconNode = null;
+		this.recoveryTextNode = null;
+	},
 });

+ 0 - 1
o2web/source/x_component_process_FormDesigner/Module/Combox/combox.html

@@ -40,7 +40,6 @@
         <div id="text{$.pid}selectEditItemDynamic" style="display: text{($.itemType=='script')?'block':'none'}" class="MWFScriptArea" name="itemDynamic" title="可选值动态脚本 (S)"></div>
 
         <div class="MWFMaplist" name="styles" title="样式"></div>
-        <div class="MWFMaplist" name="inputStyles" title="Combox样式"></div>
         <div class="MWFMaplist" name="properties" title="属性"></div>
 
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Combox/default/css.wcss

@@ -47,7 +47,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"selectIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Combox/default/icon/pull.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 21 - 0
o2web/source/x_component_process_FormDesigner/Module/Datagrid$Data.js

@@ -80,7 +80,28 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
     _setEditStyle_custom: function(name, obj, oldValue) {
         if (name == "cellType") this.checkSequence(obj, oldValue);
     },
+
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		//if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+	},
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		this.json.recoveryStyles = null;
+	},
     setCustomStyles: function(){
+		this._recoveryModuleData();
+
         var border = this.node.getStyle("border");
         this.node.clearStyles();
         this.node.setStyles(this.css.moduleNode);

+ 61 - 9
o2web/source/x_component_process_FormDesigner/Module/Form.js

@@ -330,15 +330,17 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 	},
 
 	parseModules: function(parent, dom){
-
+		var moduleNodes = [];
 		var subDom = dom.getFirst();
 		while (subDom){
 			if (subDom.get("MWFtype")){
 //				var module = subDom.retrieve("module");
 //				alert(subDom.get("id")+": "+module);
 //				if (!module){
-					var json = this.getDomjson(subDom);
-					module = this.loadModule(json, subDom, parent);
+					let json = this.getDomjson(subDom);
+					let moduleNode = subDom;
+				moduleNodes.push({"dom": moduleNode, "json": json});
+					//module = this.loadModule(json, subDom, parent);
 //				}
 //                if (module.moduleType=="container") this.parseModules(module, subDom);
 //			}else{
@@ -352,6 +354,10 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 //			}
 			subDom = subDom.getNext();
 		}
+
+		moduleNodes.each(function(obj){
+			module = this.loadModule(obj.json, obj.dom, parent);
+		}.bind(this));
 	},
 	
 	getDomjson: function(dom){
@@ -751,12 +757,53 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
             subNode = nextNode;
         }
     },
-	_getFormData: function(callback){
 
+	_copyFormJson: function(initial, final){
+		var data = final || {};
+		Object.keys(initial).each(function(k){
+			var t = typeOf(initial[k]);
+			switch (t) {
+				case "object":
+					var s = JSON.stringify(initial[k], null, "\t");
+					if (/((?:\:\s*)((\".+\")|(\d+)|(\[.+\])))/.test(s)){
+						//data[k] = {};
+						data[k] = this._copyFormJson(initial[k], data[k]);
+					}
+					break;
+				default :
+					if (initial[k]) data[k] = initial[k];
+			}
+		}.bind(this));
+		return data;
+	},
+	_preprocessingModuleData: function(){
+		//var html = this.node.innerHTML;
+		this.moduleList.each(function(module){
+			module._preprocessingModuleData();
+		});
+		// return {
+		// 	"json": this.data.json,
+		// 	"html": this.node.outerHTML
+		// }
+	},
+	_recoveryModuleData: function(){
+		this.moduleList.each(function(module){
+			//module._recoveryModuleData();
+			module.setCustomStyles();
+			if (module.setCustomInputStyles) module.setCustomInputStyles();
+		});
+	},
+
+	_getFormData: function(callback){
+		debugger;
     	this.fireEvent("queryGetFormData");
-		var copy = this.node.clone(true, true);
-		copy.clearStyles(true);
-        this.fireEvent("postGetFormData");
+
+    	this._preprocessingModuleData();
+
+    	var copy = this.node.clone(true, true);
+		copy.clearStyles();
+
+		this.fireEvent("postGetFormData");
 
         this._clearNoId(copy);
         var html = copy.outerHTML;
@@ -766,6 +813,11 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 		this.data.json.mode = this.options.mode;
 		this.data.html = html;
 
+		debugger;
+		var data = this._copyFormJson(this.data);
+
+		this._recoveryModuleData();
+
 		//@todo 预先整理表单样式
 		// var tmpFormNode = new Element("div", {
 		// 	"opacity": 0
@@ -782,8 +834,8 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 		// this.appForm.businessData = {};
 		// this.appForm.load();
 
-
-		return this.data;
+		return data;
+		//return this.data;
 	},
 	_clearNoDomModule : function(){
 		debugger;

+ 2 - 82
o2web/source/x_component_process_FormDesigner/Module/Number.js

@@ -5,88 +5,8 @@ MWF.xApplication.process.FormDesigner.Module.Number = MWF.FCNumber = new Class({
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "number",
+		"path": "../x_component_process_FormDesigner/Module/Number/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Number/number.html"
-	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Number/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Number/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "number";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "textfield",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-	
-		var icon = new Element("div", {
-			"styles": this.css.textfieldIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            // if (this.parentContainer){
-            //     if (this.parentContainer.moduleName == "datagrid$Data"){
-            //         if (!this.json.styles.width) this.json.styles.width = "90%";
-            //     }
-            // }
-            this.setCustomStyles();
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    },
-
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.textfieldIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
 	}
-
-	
 });

+ 5 - 98
o2web/source/x_component_process_FormDesigner/Module/Opinion.js

@@ -1,105 +1,12 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.Textarea", null, false);
 MWF.xApplication.process.FormDesigner.Module.Opinion = MWF.FCOpinion = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FCTextarea,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "opinion",
+		"path": "../x_component_process_FormDesigner/Module/Opinion/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Opinion/opinion.html"
-	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Opinion/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Opinion/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "opinion";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "opinion",
-			"styles": this.css.moduleNodeMove,
-			"id": this.json.id,
-			"readonly": true,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.textareaIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.textareaIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
-	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-            //this.setCustomStyles();
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
-
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    }
-	
+	}
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Opinion/default/css.wcss

@@ -50,7 +50,7 @@
 		"display": "inline-block",
 		"background": "#FFF"
 	},
-	"textareaIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Opinion/default/icon/opinion.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 5 - 96
o2web/source/x_component_process_FormDesigner/Module/Org.js

@@ -1,103 +1,12 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.Personfield", null, false);
 MWF.xApplication.process.FormDesigner.Module.Org = MWF.FCOrg = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FCPersonfield,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "org",
+		"path": "../x_component_process_FormDesigner/Module/Org/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Org/org.html"
-	},
-	initialize: function(form, options){
-		this.setOptions(options);
-
-		this.path = "../x_component_process_FormDesigner/Module/Org/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Org/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "org";
-
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-	clearTemplateStyles: function(styles){
-		if (styles){
-			if (styles.styles) this.removeStyles(styles.styles, "styles");
-			if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-			if (styles.properties) this.removeStyles(styles.properties, "properties");
-		}
-	},
-	setTemplateStyles: function(styles){
-		if (styles.styles) this.copyStyles(styles.styles, "styles");
-		if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-		if (styles.properties) this.copyStyles(styles.properties, "properties");
-	},
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "org",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-
-		var icon = new Element("div", {
-			"styles": this.css.fieldIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.fieldIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
-	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            //if (this.parentContainer){
-            //    if (this.parentContainer.moduleName == "datagrid$Data"){
-            //        if (!this.json.styles.width) this.json.styles.width = "90%";
-            //}
-            //}
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-            //this.setCustomStyles();
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
-
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    }
+	}
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Org/default/css.wcss

@@ -48,7 +48,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"fieldIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Org/default/icon/field.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 5 - 96
o2web/source/x_component_process_FormDesigner/Module/Orgfield.js

@@ -1,103 +1,12 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.Personfield", null, false);
 MWF.xApplication.process.FormDesigner.Module.Orgfield = MWF.FCOrgfield = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FCPersonfield,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "orgfield",
+		"path": "../x_component_process_FormDesigner/Module/Orgfield/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Orgfield/orgfield.html"
-	},
-	initialize: function(form, options){
-		this.setOptions(options);
-
-		this.path = "../x_component_process_FormDesigner/Module/Orgfield/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Orgfield/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "orgfield";
-
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-	clearTemplateStyles: function(styles){
-		if (styles){
-			if (styles.styles) this.removeStyles(styles.styles, "styles");
-			if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-			if (styles.properties) this.removeStyles(styles.properties, "properties");
-		}
-	},
-	setTemplateStyles: function(styles){
-		if (styles.styles) this.copyStyles(styles.styles, "styles");
-		if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-		if (styles.properties) this.copyStyles(styles.properties, "properties");
-	},
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "orgfield",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-
-		var icon = new Element("div", {
-			"styles": this.css.fieldIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.fieldIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
-	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-            //this.setCustomStyles();
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
-
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    }
+	}
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Orgfield/default/css.wcss

@@ -48,7 +48,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"fieldIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Orgfield/default/icon/field.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 58 - 90
o2web/source/x_component_process_FormDesigner/Module/Personfield.js

@@ -1,105 +1,73 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Personfield = MWF.FCPersonfield = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "personfield",
+		"path": "../x_component_process_FormDesigner/Module/Personfield/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Personfield/personfield.html"
 	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Personfield/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Personfield/"+this.options.style+"/css.wcss";
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		this.recoveryIconNode = this.node.getFirst();
+		this.recoveryIconNode.dispose();
+		this.recoveryTextNode = this.node.getFirst();
+		this.recoveryTextNode.dispose();
 
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "personfield";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "personfield",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
+		var inputNode = new Element("div", {
+			"styles": {
+				"background": "transparent",
+				"border": "0px",
+				"min-height": "24px"
+			}
+		}).inject(this.node);
+		this.node.setStyles({
+			"overflow": "hidden",
+			"position": "relative",
+			"margin-right": "20px",
+			"min-height": "24px"
+		});
+
+		if (this.json.styles){
+			this.json.recoveryStyles = Object.clone(this.json.styles);
+			if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+				if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+					this.node.setStyle(key, value);
+					delete this.json.styles[key];
 				}
+			}.bind(this));
+		}
+		if (this.json.inputStyles){
+			this.json.recoveryInputStyles = Object.clone(this.json.inputStyles);
+			var inputNode = this.node.getFirst();
+			if (inputNode){
+				if (this.json.recoveryInputStyles) Object.each(this.json.recoveryInputStyles, function(value, key){
+					if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+						inputNode.setStyle(key, value);
+						delete this.json.inputStyles[key];
+					}
+				}.bind(this));
 			}
-		}).inject(this.form.container);
-		
-		var icon = new Element("div", {
-			"styles": this.css.personfieldIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.personfieldIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
 		}
+		this.json.preprocessing = "y";
 	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            // if (this.parentContainer){
-            //     if (this.parentContainer.moduleName == "datagrid$Data"){
-            //        if (!this.json.styles.width) this.json.styles.width = "90%";
-            //     }
-            // }
-            try{
-                this.setCustomStyles();
-			}catch(e){}
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
 
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    }
+		if (this.recoveryTextNode) {
+			this.node.empty();
+			this.recoveryTextNode.inject(this.node, "top");
+		}
+		if (this.recoveryIconNode) {
+			this.recoveryIconNode.inject(this.node, "top");
+		}
 
-	
+		this.json.recoveryStyles = null;
+		this.json.recoveryInputStyles = null;
+		this.recoveryIconNode = null;
+		this.recoveryTextNode = null;
+	},
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Personfield/default/css.wcss

@@ -48,7 +48,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"personfieldIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Personfield/default/icon/selectperson.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 4 - 76
o2web/source/x_component_process_FormDesigner/Module/Radio.js

@@ -1,84 +1,12 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.Checkbox", null, false);
 MWF.xApplication.process.FormDesigner.Module.Radio = MWF.FCRadio = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FCCheckbox,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "radio",
+		"path": "../x_component_process_FormDesigner/Module/Radio/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Radio/radio.html"
-	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Radio/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Radio/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "radio";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-	
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "radio",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.radioIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.radioIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	unSelected: function(){
-		this.node.setStyles({
-			"border-width": "1px",
-			"border-color": "#999"
-		});
-		if (this.actionArea) this.actionArea.setStyle("display", "none");
-		this.form.currentSelectedModule = null;
-		
-		this.hideProperty();
-	},
-	unOver: function(){
-		if (!this.form.moveModule) if (this.form.currentSelectedModule!=this) this.node.setStyles({
-			"border-width": "1px",
-			"border-color": "#999"
-		});
-	},
-	
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
 	}
-
-	
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Radio/default/css.wcss

@@ -47,7 +47,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"radioIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Radio/default/icon/radio.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 42 - 113
o2web/source/x_component_process_FormDesigner/Module/Select.js

@@ -1,134 +1,63 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Select = MWF.FCSelect = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+        "type": "select",
+        "path": "../x_component_process_FormDesigner/Module/Select/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Select/select.html"
 	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Select/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Select/"+this.options.style+"/css.wcss";
 
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "select";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-	
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "select",
-			"styles": this.css.moduleNodeMove,
-			"id": this.json.id,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.selectIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.selectIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
+    _preprocessingModuleData: function(){
+        this.node.clearStyles();
+        this.recoveryIconNode = this.node.getFirst();
+        this.recoveryIconNode.dispose();
+        this.recoveryTextNode = this.node.getFirst();
+        this.recoveryTextNode.dispose();
 
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
+        var inputNode = new Element("select").inject(this.node);
+        if (this.json.properties) inputNode.set(this.json.properties);
 
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
-
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
+        if (this.json.styles){
+            this.json.recoveryStyles = Object.clone(this.json.styles);
+            if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+                if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+                    this.node.setStyle(key, value);
+                    delete this.json.styles[key];
                 }
             }.bind(this));
         }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
+        if (this.json.inputStyles){
+            this.json.recoveryInputStyles = Object.clone(this.json.inputStyles);
+            var inputNode = this.node.getFirst();
+            if (inputNode){
+                if (this.json.recoveryInputStyles) Object.each(this.json.recoveryInputStyles, function(value, key){
+                    if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+                        inputNode.setStyle(key, value);
+                        delete this.json.inputStyles[key];
+                    }
+                }.bind(this));
+            }
         }
+        this.json.preprocessing = "y";
     },
+    _recoveryModuleData: function(){
+        if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+        if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
 
-    _setEditStyle_custom: function(name){
-        if (name=="id"){
-            this.node.getLast().set("text", this.json.id);
+        if (this.recoveryTextNode) {
+            this.node.empty();
+            this.recoveryTextNode.inject(this.node, "top");
         }
-    },
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
+        if (this.recoveryIconNode) {
+            this.recoveryIconNode.inject(this.node, "top");
         }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
 
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
+        this.json.recoveryStyles = null;
+        this.json.recoveryInputStyles = null;
+        this.recoveryIconNode = null;
+        this.recoveryTextNode = null;
     }
-	
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Select/default/css.wcss

@@ -47,7 +47,7 @@
 		"display": "inline-block",
 		"height": "18px"
 	},
-	"selectIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Select/default/icon/pull.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 21 - 0
o2web/source/x_component_process_FormDesigner/Module/Tab$Content.js

@@ -87,6 +87,27 @@ MWF.xApplication.process.FormDesigner.Module.Tab$Content = MWF.FCTab$Content = n
 		delete this.json;
 
 		this.treeNode.destroy();
+	},
+	_preprocessingModuleData: function(){
+		this.recoveryWidgetstyle = this.node.get("style");
+		this.node.clearStyles();
+		//if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+	},
+	_recoveryModuleData: function(){
+		this.node.set("style", this.recoveryWidgetstyle);
+		this.recoveryWidgetstyle = null;
+	},
+	setCustomStyles: function(){
+		this._recoveryModuleData();
 	}
 
 });

+ 21 - 0
o2web/source/x_component_process_FormDesigner/Module/Tab$Page.js

@@ -238,6 +238,27 @@ MWF.xApplication.process.FormDesigner.Module.Tab$Page = MWF.FCTab$Page = new Cla
 		this.form.moveModule = this;
 		this.form.recordCurrentSelectedModule = this.form.currentSelectedModule;
 		this.form.selected();
+	},
+	_preprocessingModuleData: function(){
+		this.recoveryWidgetstyle = this.node.get("style");
+		this.node.clearStyles();
+		//if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+	},
+	_recoveryModuleData: function(){
+		this.node.set("style", this.recoveryWidgetstyle);
+		this.recoveryWidgetstyle = null;
+	},
+	setCustomStyles: function(){
+		this._recoveryModuleData();
 	}
 
 });

+ 22 - 1
o2web/source/x_component_process_FormDesigner/Module/Tab.js

@@ -376,5 +376,26 @@ MWF.xApplication.process.FormDesigner.Module.Tab = MWF.FCTab = new Class({
             tmpTabDiv.set("id", newElementJson.id);
 
         }.bind(this));
-    }
+    },
+	_preprocessingModuleData: function(){
+		this.recoveryWidgetstyle = this.node.get("style");
+		this.node.clearStyles();
+		//if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.json.recoveryStyles = Object.clone(this.json.styles);
+		if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+				//需要运行时处理
+			}else{
+				this.node.setStyle(key, value);
+				delete this.json.styles[key];
+			}
+		}.bind(this));
+	},
+	_recoveryModuleData: function(){
+		this.node.set("style", this.recoveryWidgetstyle);
+		this.recoveryWidgetstyle = null;
+	},
+	setCustomStyles: function(){
+		this._recoveryModuleData();
+	}
 });

+ 38 - 3
o2web/source/x_component_process_FormDesigner/Module/Table$Td.js

@@ -196,20 +196,55 @@ MWF.xApplication.process.FormDesigner.Module.Table$Td = MWF.FCTable$Td = new Cla
         }
 		
 	},
+
+	_preprocessingSetNodeStyles: function(styles){
+		Object.each(styles, function(value, key){
+			if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+				this.node.setStyle(key, value);
+			}
+		}.bind(this));
+	},
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		var addStyles = {};
+		if (this.json.cellType==="title") addStyles = this.table.json.titleTdStyles;
+		if (this.json.cellType==="content") addStyles = this.table.json.contentTdStyles;
+		if (this.json.cellType==="layout") addStyles = this.table.json.layoutTdStyles;
+		this._preprocessingSetNodeStyles(addStyles);
+
+		if (this.json.styles){
+			this.json.recoveryStyles = Object.clone(this.json.styles);
+			if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+				if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+					this.node.setStyle(key, value);
+					delete this.json.styles[key];
+				}
+			}.bind(this));
+		}
+
+		this.json.preprocessing = "y";
+	},
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		this.json.recoveryStyles = null;
+	},
+
     setCustomStyles: function(){
+		this._recoveryModuleData();
+
         var border = this.node.getStyle("border");
         this.node.clearStyles();
         this.node.setStyles(this.css.moduleNode);
 
         var addStyles = {};
         if (this.json.cellType=="title"){
-            addStyles = this.table.json.titleTdStyles
+            addStyles = this.table.json.titleTdStyles;
         }
         if (this.json.cellType=="content"){
-            addStyles = this.table.json.contentTdStyles
+            addStyles = this.table.json.contentTdStyles;
         }
         if (this.json.cellType=="layout"){
-            addStyles = this.table.json.layoutTdStyles
+            addStyles = this.table.json.layoutTdStyles;
         }
 
         if (this.initialStyles) this.node.setStyles(this.initialStyles);

+ 58 - 91
o2web/source/x_component_process_FormDesigner/Module/Textarea.js

@@ -1,105 +1,72 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Textarea = MWF.FCTextarea = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "textarea",
+		"path": "../x_component_process_FormDesigner/Module/Textarea/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Textarea/textarea.html"
 	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Textarea/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Textarea/"+this.options.style+"/css.wcss";
+	_preprocessingModuleData: function(){
+		this.node.clearStyles();
+		this.recoveryIconNode = this.node.getFirst();
+		this.recoveryIconNode.dispose();
+		this.recoveryTextNode = this.node.getFirst();
+		this.recoveryTextNode.dispose();
 
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "textarea";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "textarea",
-			"styles": this.css.moduleNodeMove,
-			"id": this.json.id,
-			"readonly": true,
-			"events": {
-				"selectstart": function(){
-					return false;
+		var inputNode = new Element("textarea", {
+			"styles": {
+				"background": "transparent",
+				"width": "100%",
+				"border": "0px"
+			}
+		}).inject(this.node);
+		this.node.setStyles({
+			"ovwrflow": "hidden",
+			"position": "relative",
+			"padding-right": "2px"
+		});
+
+		if (this.json.styles){
+			this.json.recoveryStyles = Object.clone(this.json.styles);
+			if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
+				if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+					this.node.setStyle(key, value);
+					delete this.json.styles[key];
 				}
+			}.bind(this));
+		}
+		if (this.json.inputStyles){
+			this.json.recoveryInputStyles = Object.clone(this.json.inputStyles);
+			var inputNode = this.node.getFirst();
+			if (inputNode){
+				if (this.json.recoveryInputStyles) Object.each(this.json.recoveryInputStyles, function(value, key){
+					if ((value.indexOf("x_processplatform_assemble_surface")==-1 && value.indexOf("x_portal_assemble_surface")==-1)){
+						inputNode.setStyle(key, value);
+						delete this.json.inputStyles[key];
+					}
+				}.bind(this));
 			}
-		}).inject(this.form.container);
-		var icon = new Element("div", {
-			"styles": this.css.textareaIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-		if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.textareaIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
 		}
+		this.json.preprocessing = "y";
 	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                    if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-            //this.setCustomStyles();
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
+	_recoveryModuleData: function(){
+		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
+		if (this.json.recoveryInputStyles) this.json.inputStyles = this.json.recoveryInputStyles;
+
+		if (this.recoveryTextNode) {
+			this.node.empty();
+			this.recoveryTextNode.inject(this.node, "top");
+		}
+		if (this.recoveryIconNode) {
+			this.recoveryIconNode.inject(this.node, "top");
+		}
 
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    }
-	
+		this.json.recoveryStyles = null;
+		this.json.recoveryInputStyles = null;
+		this.recoveryIconNode = null;
+		this.recoveryTextNode = null;
+	}
 });

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Textarea/default/css.wcss

@@ -50,7 +50,7 @@
 		"display": "inline-block",
 		"background": "#FFF"
 	},
-	"textareaIcon": {
+	"textfieldIcon": {
 		"background": "url("+"../x_component_process_FormDesigner/Module/Textarea/default/icon/textarea.png) center center no-repeat",
 		"width": "18px",
 		"height": "18px",

+ 4 - 115
o2web/source/x_component_process_FormDesigner/Module/Textfield.js

@@ -1,123 +1,12 @@
 MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
-MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
+MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Input", null, false);
 MWF.xApplication.process.FormDesigner.Module.Textfield = MWF.FCTextfield = new Class({
-	Extends: MWF.FC$Element,
+	Extends: MWF.FC$Input,
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
+		"type": "textfield",
+		"path": "../x_component_process_FormDesigner/Module/Textfield/",
 		"propertyPath": "../x_component_process_FormDesigner/Module/Textfield/textfield.html"
-	},
-	
-	initialize: function(form, options){
-		this.setOptions(options);
-		
-		this.path = "../x_component_process_FormDesigner/Module/Textfield/";
-		this.cssPath = "../x_component_process_FormDesigner/Module/Textfield/"+this.options.style+"/css.wcss";
-
-		this._loadCss();
-		this.moduleType = "element";
-		this.moduleName = "textfield";
-		
-		this.form = form;
-		this.container = null;
-		this.containerNode = null;
-	},
-    clearTemplateStyles: function(styles){
-        if (styles){
-            if (styles.styles) this.removeStyles(styles.styles, "styles");
-            if (styles.inputStyles) this.removeStyles(styles.inputStyles, "inputStyles");
-            if (styles.properties) this.removeStyles(styles.properties, "properties");
-        }
-    },
-    setTemplateStyles: function(styles){
-        if (styles.styles) this.copyStyles(styles.styles, "styles");
-        if (styles.inputStyles) this.copyStyles(styles.inputStyles, "inputStyles");
-        if (styles.properties) this.copyStyles(styles.properties, "properties");
-    },
-
-	_createMoveNode: function(){
-		this.moveNode = new Element("div", {
-			"MWFType": "textfield",
-			"id": this.json.id,
-			"styles": this.css.moduleNodeMove,
-			"events": {
-				"selectstart": function(){
-					return false;
-				}
-			}
-		}).inject(this.form.container);
-	
-		var icon = new Element("div", {
-			"styles": this.css.textfieldIcon
-		}).inject(this.moveNode);
-		var text = new Element("div", {
-			"styles": this.css.moduleText,
-			"text": this.json.id
-		}).inject(this.moveNode);
-	},
-    setPropertiesOrStyles: function(name){
-        if (name=="styles"){
-            if (this.parentContainer){
-                if (this.parentContainer.moduleName == "datagrid$Data"){
-                   //if (!this.json.styles.width) this.json.styles.width = "90%";
-                }
-            }
-            try{
-                this.setCustomStyles();
-            }catch(e){}
-            //this.setCustomStyles();
-        }
-        if (name=="inputStyles"){
-            var text = this.node.getLast("div");
-            text.clearStyles();
-            text.setStyles(this.css.moduleText);
-
-            Object.each(this.json.inputStyles, function(value, key){
-                var reg = /^border\w*/ig;
-                if (!key.test(reg)){
-                    text.setStyle(key, value);
-                }
-            }.bind(this));
-        }
-        if (name=="properties"){
-            this.node.setProperties(this.json.properties);
-        }
-    },
-
-	_loadNodeStyles: function(){
-		var icon = this.node.getFirst("div");
-		var text = this.node.getLast("div");
-        if (!icon) icon = new Element("div").inject(this.node, "top");
-        if (!text) text = new Element("div").inject(this.node, "bottom");
-		icon.setStyles(this.css.textfieldIcon);
-		text.setStyles(this.css.moduleText);
-	},
-	_getCopyNode: function(){
-		if (!this.copyNode) this._createCopyNode();
-		this.copyNode.setStyle("display", "inline-block");
-		return this.copyNode;
-	},
-	
-	_setEditStyle_custom: function(name){
-		if (name=="id"){
-			this.node.getLast().set("text", this.json.id);
-		}
-        //if (name=="isTitle"){
-        //    if (this.json.isTitle){
-        //        this.form.moduleList.each(function(module){
-        //            if (module.moduleName=="textfield"){
-        //                if (module.json.id!=this.json.id){
-        //                    module.json.isTitle = false;
-        //                    if (module.property){
-        //                        var td = module.property.propertyContent.getElementById(module.json.id+"isTitleArea");
-        //                        if (td) td.getElements("input")[1].set("checked", true);
-        //                    }
-        //                }
-        //            }
-        //        }.bind(this));
-        //    }
-        //}
 	}
-
-	
 });

+ 14 - 10
o2web/source/x_component_process_Xform/$Input.js

@@ -111,8 +111,8 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
             if (this.descriptionNode) this.descriptionNode.setStyle("display", "none");
         }
     },
-    _loadNodeEdit: function(){
-		var input = new Element("input", {
+    _resetNodeEdit: function(){
+        var input = new Element("input", {
             "styles": {
                 "background": "transparent",
                 "width": "100%",
@@ -120,18 +120,22 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
             },
             "readonly": true
         });
-		input.set(this.json.properties);
 
         var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            "position": "relative",
-            "margin-right": "20px",
-            "padding-right": "4px"
-        }}).inject(this.node, "after");
+                "overflow": "hidden",
+                "position": "relative",
+                "margin-right": "20px",
+                "padding-right": "4px"
+            }}).inject(this.node, "after");
         input.inject(node);
 
         this.node.destroy();
-		this.node = node;
+        this.node = node;
+    },
+    _loadNodeEdit: function(){
+	    if (!this.json.preprocessing) this._resetNodeEdit();
+	    var input = this.node.getFirst();
+        input.set(this.json.properties);
 		this.node.set({
 			"id": this.json.id,
 			"MWFType": this.json.type,
@@ -174,7 +178,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
         }
     },
     _computeValue: function(value){
-        return (this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value || "");
+        return (this.json.defaultValue && this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value || "");
     },
 	getValue: function(){
         var value = this._getBusinessData();

+ 1 - 1
o2web/source/x_component_process_Xform/$Module.js

@@ -152,7 +152,7 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module =  new Class({
             case "splitValue":
                 return this._getBusinessSectionDataBySplitValue();
             case "script":
-                return this._getBusinessSectionDataByScript(this.json.sectionByScript.code);
+                return this._getBusinessSectionDataByScript(((this.json.sectionByScript) ? this.json.sectionByScript.code : ""));
             default:
                 return this.form.businessData.data[this.json.id] || "";
         }

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

@@ -30,15 +30,17 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
             this.node.set("text", texts.join(", "));
         }
     },
+    _resetNodeEdit: function(){
+        var div = new Element("div");
+        div.set(this.json.properties);
+        div.inject(this.node, "after");
 
+        this.node.destroy();
+        this.node = div;
+    },
     _loadNodeEdit: function(){
 		//this.container = new Element("select");
-		var div = new Element("div");
-		div.set(this.json.properties);
-		div.inject(this.node, "after");
-	
-		this.node.destroy();
-		this.node = div;
+        if (!this.json.preprocessing) this._resetNodeEdit();
 		this.node.set({
 			"id": this.json.id,
 			"MWFType": this.json.type,
@@ -87,7 +89,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
 		if (this.json.itemType == "values"){
 			return this.json.itemValues;
 		}else{
-			return this.form.Macro.exec(this.json.itemScript.code, this);
+			return this.form.Macro.exec(((this.json.itemScript) ? this.json.itemScript.code : ""), this);
 		}
 		//return [];
 	},
@@ -104,7 +106,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
 
                 var radio = new Element("input", {
                     "type": "checkbox",
-                    "name": this.json.properties.name || flag+this.json.id,
+                    "name": ((this.json.properties) ? this.json.properties.name : null) || flag+this.json.id,
                     "value": value,
                     "showText": text,
                     "styles": this.json.buttonStyles

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

@@ -70,8 +70,8 @@ MWF.xApplication.process.Xform.Combox = MWF.APPCombox =  new Class({
 					"value": value,
 					"callback": callback
 				};
-                this.form.Macro.fire(this.json.itemDynamic.code, this, event);
-			}.bind(this)
+                this.form.Macro.fire(((this.json.itemDynamic) ? this.json.itemDynamic.code : ""), this, event);
+			}.bind(this);
 		}else{
         	return null;
 		}
@@ -81,7 +81,7 @@ MWF.xApplication.process.Xform.Combox = MWF.APPCombox =  new Class({
         if (this.json.itemType === "values"){
             list = this.json.itemValues;
         }else if (this.json.itemType === "script"){
-            list = this.form.Macro.exec(this.json.itemScript.code, this);
+            list = this.form.Macro.exec(((this.json.itemScript) ? this.json.itemScript.code : ""), this);
         }
 
         if (list.length){

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

@@ -26,7 +26,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
         this.createMobileTable();
 
         this.editable = (!this.readonly);
-        if (this.editable) this.editable = this.form.Macro.exec(this.json.editableScript.code, this);
+        if (this.editable) this.editable = this.form.Macro.exec(((this.json.editableScript) ? this.json.editableScript.code : ""), this);
         //this.editable = false;
 
         this.gridData = this._getValue();
@@ -90,7 +90,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
 		var value = [];
 		value = this._getBusinessData();
 		if (!value){
-			if (this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
+			if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
             value = {"data": value || []};
 		}
 		return value || [];

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

@@ -24,7 +24,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 		this.table = this.node.getElement("table");
 
         this.editable = (this.readonly) ? false : true;
-        if (this.editable) this.editable = this.form.Macro.exec(this.json.editableScript.code, this);
+        if (this.editable) this.editable = this.form.Macro.exec(((this.json.editableScript) ? this.json.editableScript.code : ""), this);
 
 		this.gridData = this._getValue();
 
@@ -58,7 +58,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 		var value = [];
 		value = this._getBusinessData();
 		if (!value){
-			if (this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
+			if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
             value = {"data": value || []};
 		}
 		return value || {};

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

@@ -93,7 +93,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         return css;
     },
     loadCss: function () {
-        cssText = this.json.css.code;
+        cssText = (this.json.css) ? this.json.css.code : "";
         //var head = (document.head || document.getElementsByTagName("head")[0] || document.documentElement);
         var styleNode = $("style" + this.json.id);
         if (styleNode) styleNode.destroy();
@@ -709,7 +709,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         });
     },
     _loadJsheader: function () {
-        var code = this.json.jsheader.code;
+        var code = (this.json.jsheader) ? this.json.jsheader.code : "";
         if (code) Browser.exec(code);
     },
     _loadEvents: function () {

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

@@ -7,7 +7,7 @@ MWF.xApplication.process.Xform.Iframe = MWF.APPIframe =  new Class({
 
         var src = this.json.src;
         if (this.json.valueType=="script"){
-            src = this.form.Macro.exec(this.json.script.code, this);
+            src = this.form.Macro.exec(((this.json.script) ? this.json.script.code : ""), this);
         }
 
 		this.iframe = new Element("iframe", {

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

@@ -124,8 +124,8 @@ MWF.xApplication.process.Xform.ImageClipper = MWF.APPImageClipper =  new Class({
         if( clipperType == "unrestricted" ){
             ratio = 0;
         }else if( clipperType == "size" ){
-            var width = this.json.imageWidth.toInt();
-            var height = this.json.imageHeight.toInt();
+            var width = (this.json.imageWidth) ? this.json.imageWidth.toInt() : 600;
+            var height = (this.json.imageHeight) ? this.json.imageHeight.toInt() : 500;
             ratio = width / height;
             maxSize = Math.max( width, height );
             if( !isNaN( width ) && !isNaN( height )  ){

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

@@ -8,7 +8,7 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel =  new Class({
 			this.node.set("text", this.json.text || "");
 		}
 		if (this.json.valueType == "script"){
-			var code = this.json.script.code;
+			var code = (this.json.script) ? this.json.script.code : "";
 			if (code){
 				this.node.set("text", this.form.Macro.exec(code, this) || "");
 			} 

+ 7 - 7
o2web/source/x_component_process_Xform/Log.js

@@ -232,7 +232,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
             this.form.Macro.environment.list = null;
             flag = this.form.Macro.exec(this.json.filterScript.code, this);
         }else{
-            if (this.json.filterActivity.length){
+            if (this.json.filterActivity && this.json.filterActivity.length){
                 filterActivitys = this.json.filterActivity;
                 flag = (filterActivitys.indexOf(log.fromActivityName)!==-1);
             }
@@ -246,7 +246,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
                 flag = (this.json.filterPerson.indexOf(log.person)!==-1);
                 if (!flag) flag = (this.json.filterPerson.indexOf(o2.name.cn(log.person))!==-1);
             }
-            if (this.json.filterRoute.length){
+            if (this.json.filterRoute && this.json.filterRoute.length){
                 filterRoutes = this.json.filterRoute;
                 flag = (filterRoutes.indexOf(log.properties.routeName)!==-1);
             }
@@ -613,7 +613,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
             if( !this.categoryList.length )return;
             this.expandCount = 0;
             if( this.json.expand && this.json.expand === "enable" ){
-                this.expandCount = parseInt( this.json.expandCount );
+                this.expandCount = parseInt( this.json.expandCount || 0 );
             }
             this.table = new Element("table", this.json.tableProperties).inject( this.node );
             this.categoryList.each( function( key, idx ){
@@ -1282,7 +1282,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
             this.form.Macro.environment.list = null;
             flag = this.form.Macro.exec(this.json.filterScript.code, this);
         }else{
-            if (this.json.filterActivity.length){
+            if (this.json.filterActivity && this.json.filterActivity.length){
                 filterActivitys = this.json.filterActivity;
                 flag = (filterActivitys.indexOf(log.fromActivityName)!==-1);
             }
@@ -1292,7 +1292,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
                     flag = ((log.fromActivityAlias) && filterActivityAlias.indexOf(log.fromActivityAlias)!==-1);
                 }
             }
-            if (this.json.filterPerson.length){
+            if (this.json.filterPerson && this.json.filterPerson.length){
                 flag = false;
                 filterPersons = this.json.filterPerson;
                 var tmpTaskCompletedList = [];
@@ -1307,7 +1307,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
                     flag = true;
                 }
             }
-            if (this.json.filterRoute.length){
+            if (this.json.filterRoute && this.json.filterRoute.length){
                 filterRoutes = this.json.filterRoute;
                 flag = (filterRoutes.indexOf(log.routeName)!==-1);
             }
@@ -1321,7 +1321,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
             this.form.Macro.environment.list = list;
             flag = this.form.Macro.exec(this.json.filterScript.code, this);
         }else{
-            if (this.json.filterPerson.length){
+            if (this.json.filterPerson && this.json.filterPerson.length){
                 flag = ((filterPersons.indexOf(list.person)!==-1)|| (filterPersons.indexOf(list.identity)!==-1));
             }
         }

+ 15 - 8
o2web/source/x_component_process_Xform/Number.js

@@ -136,7 +136,8 @@ MWF.xApplication.process.Xform.Number = MWF.APPNumber =  new Class({
         }
         return true;
     },
-    _loadNodeEdit: function(){
+
+    _resetNodeEdit: function(){
         var input = new Element("input", {
             "styles": {
                 "background": "transparent",
@@ -144,18 +145,24 @@ MWF.xApplication.process.Xform.Number = MWF.APPNumber =  new Class({
                 "border": "0px"
             }
         });
-        input.set(this.json.properties);
 
         var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            "position": "relative",
-            "margin-right": "20px",
-            "padding-right": "4px"
-        }}).inject(this.node, "after");
+                "overflow": "hidden",
+                "position": "relative",
+                "margin-right": "20px",
+                "padding-right": "4px"
+            }}).inject(this.node, "after");
         input.inject(node);
 
         this.node.destroy();
         this.node = node;
+    },
+
+    _loadNodeEdit: function(){
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
+
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type,
@@ -184,7 +191,7 @@ MWF.xApplication.process.Xform.Number = MWF.APPNumber =  new Class({
         }.bind(this));
     },
     _computeValue: function(value){
-        return (this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value || "0");
+        return (this.json.defaultValue && this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value || "0");
     },
     getValue: function(){
         var value = this._getBusinessData();

+ 2 - 1
o2web/source/x_component_process_Xform/Office.js

@@ -429,7 +429,7 @@ MWF.xApplication.process.Xform.Office = MWF.APPOffice =  new Class({
     },
     loadMenu: function(){
         if (!this.isMenuLoad){
-            if (this.json.menuEditButtons.length){
+            if (this.json.menuEditButtons && this.json.menuEditButtons.length){
                 this.menuNode = new Element("div", {"styles": this.form.css.officeMenuNode}).inject(this.node, "top");
                 MWF.require("MWF.widget.Toolbar", function(){
                     this.toolbarWidget = new MWF.widget.Toolbar(this.menuNode, {"style": "xform_blue_simple"}, this);
@@ -1054,6 +1054,7 @@ MWF.xApplication.process.Xform.Office = MWF.APPOffice =  new Class({
     },
     checkAutoSaveNumber: function(callback){
         if (!this.autoSavedAttachments) this.autoSavedAttachments = [];
+        if (!this.json.autoSaveNumber) this.json.autoSaveNumber = 3;
         if (this.autoSavedAttachments.length >= this.json.autoSaveNumber.toInt()){
             //delete first att
             var att = this.autoSavedAttachments.shift();

+ 18 - 11
o2web/source/x_component_process_Xform/Opinion.js

@@ -82,22 +82,29 @@ MWF.xApplication.process.Xform.Opinion = MWF.APPOpinion =  new Class({
         }
         return true;
     },
-    _loadNodeEdit: function(){
-		var input = new Element("textarea", {"styles": {
-            "background": "transparent",
-            "width": "100%",
-            "border": "0px"
-        }});
-		input.set(this.json.properties);
+
+    _resetNodeEdit: function(){
+        var input = new Element("textarea", {"styles": {
+                "background": "transparent",
+                "width": "100%",
+                "border": "0px"
+            }});
+        input.set(this.json.properties);
 
         var node = new Element("div", {"styles": {
-            "ovwrflow": "hidden",
-            "position": "relative",
-            "padding-right": "2px"
-        }}).inject(this.node, "after");
+                "ovwrflow": "hidden",
+                "position": "relative",
+                "padding-right": "2px"
+            }}).inject(this.node, "after");
         input.inject(node);
         this.node.destroy();
         this.node = node;
+    },
+    _loadNodeEdit: function(){
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
+
 		//this.node = input;
 		this.node.set({
 			"id": this.json.id,

+ 26 - 18
o2web/source/x_component_process_Xform/Org.js

@@ -509,6 +509,18 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
             if (callback) callback(data);
         });
     },
+
+    _resetNodeInputEdit: function(){
+        var node = new Element("div", {
+            "styles": {
+                "overflow": "hidden",
+                //"position": "relative",
+                "margin-right": "20px"
+            }
+        }).inject(this.node, "after");
+        this.node.destroy();
+        this.node = node;
+    },
     _loadNodeInputEdit: function(){
         var input=null;
         MWF.require("MWF.widget.Combox", function(){
@@ -533,16 +545,10 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         });
         input.set(this.json.properties);
 
-        var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            //"position": "relative",
-            "margin-right": "20px"
-        }}).inject(this.node, "after");
-        input.inject(node);
-        //this.combox = input;
+        if (!this.json.preprocessing) this._resetNodeInputEdit();
 
-        this.node.destroy();
-        this.node = node;
+        this.node.empty();
+        input.inject(this.node);
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type
@@ -566,8 +572,8 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
             if (this.validation()) this._setBusinessData(this.getInputData("change"));
         }.bind(this));
     },
-    _loadNodeEdit: function(){
 
+    _resetNodeEdit: function(){
         var input = new Element("div", {
             "styles": {
                 "background": "transparent",
@@ -575,18 +581,20 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
                 "min-height": "24px"
             }
         });
-        input.set(this.json.properties);
-
         var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            "position": "relative",
-            "margin-right": "20px",
-            "min-height": "24px"
-        }}).inject(this.node, "after");
+                "overflow": "hidden",
+                "position": "relative",
+                "margin-right": "20px",
+                "min-height": "24px"
+            }}).inject(this.node, "after");
         input.inject(node);
-
         this.node.destroy();
         this.node = node;
+    },
+    _loadNodeEdit: function(){
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type,

+ 36 - 28
o2web/source/x_component_process_Xform/Orgfield.js

@@ -153,6 +153,18 @@ MWF.xApplication.process.Xform.Orgfield = MWF.APPOrgfield =  new Class({
             if (callback) callback(data);
         });
     },
+
+    _resetNodeInputEdit: function(){
+        var node = new Element("div", {
+            "styles": {
+                "overflow": "hidden",
+                //"position": "relative",
+                "margin-right": "20px"
+            }
+        }).inject(this.node, "after");
+        this.node.destroy();
+        this.node = node;
+    },
     _loadNodeInputEdit: function(){
         var input=null;
         MWF.require("MWF.widget.Combox", function(){
@@ -177,16 +189,10 @@ MWF.xApplication.process.Xform.Orgfield = MWF.APPOrgfield =  new Class({
         });
         input.set(this.json.properties);
 
-        var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            //"position": "relative",
-            "margin-right": "20px"
-        }}).inject(this.node, "after");
-        input.inject(node);
-        //this.combox = input;
+        if (!this.json.preprocessing) this._resetNodeInputEdit();
 
-        this.node.destroy();
-        this.node = node;
+        this.node.empty();
+        input.inject(this.node);
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type
@@ -211,26 +217,28 @@ MWF.xApplication.process.Xform.Orgfield = MWF.APPOrgfield =  new Class({
         }.bind(this));
     },
 
+    _resetNodeEdit: function(){
+        var input = new Element("div", {
+            "styles": {
+                "background": "transparent",
+                "border": "0px",
+                "min-height": "24px"
+            }
+        });
+        var node = new Element("div", {"styles": {
+                "overflow": "hidden",
+                "position": "relative",
+                "margin-right": "20px",
+                "min-height": "24px"
+            }}).inject(this.node, "after");
+        input.inject(node);
+        this.node.destroy();
+        this.node = node;
+    },
 	_loadNodeEdit : function(){
-		var input = this.input = new Element("div", {
-			"styles": {
-				"background": "transparent",
-				"border": "0px",
-                "min-height": "20px"
-			}
-		});
-		input.set(this.json.properties);
-
-		var node = new Element("div", {"styles": {
-			"overflow": "hidden",
-			"position": "relative",
-			"min-height" : "20px",
-			"margin-right": "20px"
-		}}).inject(this.node, "after");
-		input.inject(node);
-
-		this.node.destroy();
-		this.node = node;
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
 		this.node.set({
 			"id": this.json.id,
 			"MWFType": this.json.type,

+ 25 - 20
o2web/source/x_component_process_Xform/Personfield.js

@@ -487,6 +487,17 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
             if (callback) callback(data);
         });
     },
+    _resetNodeInputEdit: function(){
+        var node = new Element("div", {
+            "styles": {
+                "overflow": "hidden",
+                //"position": "relative",
+                "margin-right": "20px"
+            }
+        }).inject(this.node, "after");
+        this.node.destroy();
+        this.node = node;
+    },
     _loadNodeInputEdit: function() {
         var input = null;
         MWF.require("MWF.widget.Combox", function () {
@@ -511,18 +522,10 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
         });
         input.set(this.json.properties);
 
-        var node = new Element("div", {
-            "styles": {
-                "overflow": "hidden",
-                //"position": "relative",
-                "margin-right": "20px"
-            }
-        }).inject(this.node, "after");
-        input.inject(node);
-        //this.combox = input;
+        if (!this.json.preprocessing) this._resetNodeInputEdit();
 
-        this.node.destroy();
-        this.node = node;
+        this.node.empty();
+        input.inject(this.node);
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type
@@ -546,8 +549,8 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
             if (this.validation()) this._setBusinessData(this.getInputData("change"));
         }.bind(this));
     },
-    _loadNodeEdit: function(){
 
+    _resetNodeEdit: function(){
         var input = new Element("div", {
             "styles": {
                 "background": "transparent",
@@ -555,18 +558,20 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
                 "min-height": "24px"
             }
         });
-        input.set(this.json.properties);
-
         var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            "position": "relative",
-            "margin-right": "20px",
-            "min-height": "24px"
-        }}).inject(this.node, "after");
+                "overflow": "hidden",
+                "position": "relative",
+                "margin-right": "20px",
+                "min-height": "24px"
+            }}).inject(this.node, "after");
         input.inject(node);
-
         this.node.destroy();
         this.node = node;
+    },
+    _loadNodeEdit: function(){
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type,

+ 9 - 6
o2web/source/x_component_process_Xform/Radio.js

@@ -36,15 +36,18 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio =  new Class({
             this.node.set("text", texts);
         }
     },
+    _resetNodeEdit: function(){
+        var div = new Element("div");
+        div.set(this.json.properties);
+        div.inject(this.node, "after");
 
+        this.node.destroy();
+        this.node = div;
+    },
     _loadNodeEdit: function(){
 		//this.container = new Element("select");
-		var div = new Element("div");
-		div.set(this.json.properties);
-		div.inject(this.node, "after");
-	
-		this.node.destroy();
-		this.node = div;
+        if (!this.json.preprocessing) this._resetNodeEdit();
+
 		this.node.set({
 			"id": this.json.id,
 			"MWFType": this.json.type,

+ 9 - 4
o2web/source/x_component_process_Xform/Select.js

@@ -86,14 +86,19 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect =  new Class({
             if (this.json.styles) this.node.setStyles(this.json.styles);
 		}
     },
-    _loadNodeEdit: function(){
-        this.node.empty();
+	_resetNodeEdit: function(){
+		this.node.empty();
 		var select = new Element("select");
 		select.set(this.json.properties);
 		select.inject(this.node);
-		//this.node.destroy();
+	},
+    _loadNodeEdit: function(){
+		if (!this.json.preprocessing) this._resetNodeEdit();
+
+		var select = this.node.getFirst();
 		this.areaNode = this.node;
 		this.node = select;
+
 		this.node.set({
 			"id": this.json.id,
 			"MWFType": this.json.type,
@@ -120,7 +125,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect =  new Class({
 		if (this.json.itemType == "values"){
 			return this.json.itemValues;
 		}else{
-			return this.form.Macro.exec(this.json.itemScript.code, this);
+			return this.form.Macro.exec(((this.json.itemScript) ? this.json.itemScript.code : ""), this);
 		}
 		return [];
 	},

+ 1 - 0
o2web/source/x_component_process_Xform/Source.js

@@ -106,6 +106,7 @@ MWF.xApplication.process.Xform.Source = MWF.APPSource =  new Class({
         this._getO2Uri();
     },
     reload: function(notInit, callback){
+	    this._getO2Uri();
         this._invoke(function(){
             this._loadSub(this.node, notInit);
             this.fireEvent("loadData");

+ 17 - 15
o2web/source/x_component_process_Xform/Stat.js

@@ -20,22 +20,24 @@ MWF.xApplication.process.Xform.Stat = MWF.APPStat =  new Class({
 	    this.active();
     },
     loadStat: function(){
-        var viewJson = {
-            "application": this.json.queryStat.appName,
-            "statName": this.json.queryStat.name,
-            "isChart": (this.json.isChart!="no"),
-            "isLegend": (this.json.isLegend!="no"),
-            "isTable": (this.json.isTable!="no")
-        };
+	    if (this.json.queryStat){
+            var viewJson = {
+                "application": this.json.queryStat.appName,
+                "statName": this.json.queryStat.name,
+                "isChart": (this.json.isChart!="no"),
+                "isLegend": (this.json.isLegend!="no"),
+                "isTable": (this.json.isTable!="no")
+            };
 
-        MWF.xDesktop.requireApp("query.Query", "Statistician", function(){
-            this.stat = new MWF.xApplication.query.Query.Statistician(this.form.app, this.node, viewJson, {
-                "resizeNode": (this.node.getStyle("height").toString().toLowerCase()!=="auto" && this.node.getStyle("height").toInt()>0),
-                "onLoaded": function(){
-                    this.fireEvent("loadStat");
-                }.bind(this)
-            });
-        }.bind(this));
+            MWF.xDesktop.requireApp("query.Query", "Statistician", function(){
+                this.stat = new MWF.xApplication.query.Query.Statistician(this.form.app, this.node, viewJson, {
+                    "resizeNode": (this.node.getStyle("height").toString().toLowerCase()!=="auto" && this.node.getStyle("height").toInt()>0),
+                    "onLoaded": function(){
+                        this.fireEvent("loadStat");
+                    }.bind(this)
+                });
+            }.bind(this));
+        }
     },
     getData: function(){
         if (!this.stat) return null;

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

@@ -124,7 +124,7 @@ MWF.xApplication.process.Xform.Subform = MWF.APPSubform =  new Class({
         var method = (this.form.json.mode !== "Mobile" && !layout.mobile) ? "getForm": "getFormMobile";
 
         if (this.json.subformType==="script"){
-            if (this.json.subformScript.code){
+            if (this.json.subformScript && this.json.subformScript.code){
                 var data = this.form.Macro.exec(this.json.subformScript.code, this);
                 if (data){
                     var formName, app;
@@ -197,7 +197,7 @@ MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
         }.bind(this));
     },
     show : function(){
-        if (this.json.submitScript.code) {
+        if (this.json.submitScript && this.json.submitScript.code) {
             this.form.Macro.exec(this.json.submitScript.code, this);
         }
         // this.fireSubFormEvent("load");
@@ -264,7 +264,7 @@ MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
     getSubform: function(callback){
         var method = (this.form.json.mode !== "Mobile" && !layout.mobile) ? "getForm": "getFormMobile";
         if (this.json.submitFormType==="script"){
-            if (this.json.submitFormScript.code){
+            if (this.json.submitFormScript && this.json.submitFormScript.code){
                 var data = this.form.Macro.exec(this.json.submitFormScript.code, this);
                 if (data){
                     var formName, app;

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

@@ -126,7 +126,7 @@ MWF.xApplication.process.Xform.Subpage = MWF.APPSubpage =  new Class({
         var method = (this.form.json.mode !== "Mobile" && !layout.mobile) ? "getPageByName": "getPageByNameMobile";
 
         if (this.json.subpageType==="script"){
-            if (this.json.subpageScript.code){
+            if (this.json.subpageScript && this.json.subpageScript.code){
                 var formNome = this.form.Macro.exec(this.json.subpageScript.code, this);
                 if (formNome){
                     var app = this.form.businessData.pageInfor.portal;
@@ -169,7 +169,7 @@ MWF.xApplication.process.Xform.Subpage = MWF.APPSubpage =  new Class({
         if( this.json.parameterType === "map" ){
             params = this.json.parametersMapList;
         }else if( this.json.parameterType === "script" ){
-            var code = this.json.parametersScript.code;
+            var code = (this.json.parametersScript) ? this.json.parametersScript.code : "";
             if (code){
                 params = this.form.Macro.exec(code, this);
             }

+ 43 - 6
o2web/source/x_component_process_Xform/Table.js

@@ -47,7 +47,7 @@ MWF.xApplication.process.Xform.Table = MWF.APPTable =  new Class({
 		// }.bind(this));
 	},
     _loadBorderStyle: function(){
-        if (this.json.styles.border){
+        if (this.json.styles && this.json.styles.border){
             if (!this.table) this.table = this.node.getElement("table");
             if( this.json.styles["table-layout"] ){
                 this.table.setStyle("table-layout",this.json.styles["table-layout"]);
@@ -89,18 +89,55 @@ MWF.xApplication.process.Xform.Table$Td = MWF.APPTable$Td =  new Class({
         //this.form._loadModules(this.node);
     },
     _loadStyles: function(){
+
         var addStyles = {};
         if (this.json.cellType=="title"){
-            addStyles = this.table.json.titleTdStyles
+            addStyles = this.table.json.titleTdStyles;
         }
         if (this.json.cellType=="content"){
-            addStyles = this.table.json.contentTdStyles
+            addStyles = this.table.json.contentTdStyles;
         }
         if (this.json.cellType=="layout"){
-            addStyles = this.table.json.layoutTdStyles
+            addStyles = this.table.json.layoutTdStyles;
         }
-        this.node.setStyles(addStyles);
-        this.node.setStyles(this.json.styles);
+        Object.each(addStyles, function(value, key){
+            if ((value.indexOf("x_processplatform_assemble_surface")!==-1 || value.indexOf("x_portal_assemble_surface")!==-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }
+                if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                    value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                    value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+                this.node.setStyle(key, value);
+            }else{
+                if (!this.json.preprocessing) this.node.setStyle(key, value);
+            }
+
+        }.bind(this));
+
+        Object.each(this.json.styles, function(value, key){
+            if ((value.indexOf("x_processplatform_assemble_surface")!==-1 || value.indexOf("x_portal_assemble_surface")!==-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }
+                if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                    value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                    value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+            }
+            this.node.setStyle(key, value);
+        }.bind(this));
 
         if (this.json.cellType=="content"){
             this.form.addEvent("postLoad", function(){

+ 18 - 14
o2web/source/x_component_process_Xform/Textarea.js

@@ -31,24 +31,28 @@ MWF.xApplication.process.Xform.Textarea = MWF.APPTextarea =  new Class({
             this.node.set("html", text);
         }
     },
-    _loadNodeEdit: function(){
-		var input = new Element("textarea", {"styles": {
-            "background": "transparent",
-            "width": "100%",
-            "border": "0px"
-        }});
-		input.set(this.json.properties);
-        if( this.form.json.textareaDisableResize )input.setStyle("resize","none");
-
+    _resetNodeEdit: function(){
+        var input = new Element("textarea", {"styles": {
+                "background": "transparent",
+                "width": "100%",
+                "border": "0px"
+            }});
         var node = new Element("div", {"styles": {
-            "ovwrflow": "hidden",
-            "position": "relative",
-            "padding-right": "2px"
-        }}).inject(this.node, "after");
+                "ovwrflow": "hidden",
+                "position": "relative",
+                "padding-right": "2px"
+            }}).inject(this.node, "after");
         input.inject(node);
         this.node.destroy();
         this.node = node;
-		//this.node = input;
+    },
+    _loadNodeEdit: function(){
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
+
+        if( this.form.json.textareaDisableResize )input.setStyle("resize","none");
+
 		this.node.set({
 			"id": this.json.id,
 			"MWFType": this.json.type

+ 14 - 8
o2web/source/x_component_process_Xform/Textfield.js

@@ -78,7 +78,8 @@ MWF.xApplication.process.Xform.Textfield = MWF.APPTextfield =  new Class({
     _loadNodeRead: function(){
         this.node.empty();
     },
-    _loadNodeEdit: function(){
+
+    _resetNodeEdit: function(){
         var input = new Element("input", {
             "styles": {
                 "background": "transparent",
@@ -87,18 +88,23 @@ MWF.xApplication.process.Xform.Textfield = MWF.APPTextfield =  new Class({
                 "border": "0px"
             }
         });
-        input.set(this.json.properties);
 
         var node = new Element("div", {"styles": {
-            "overflow": "hidden",
-            "position": "relative",
-            "margin-right": "20px",
-            "padding-right": "4px"
-        }}).inject(this.node, "after");
+                "overflow": "hidden",
+                "position": "relative",
+                "margin-right": "20px",
+                "padding-right": "4px"
+            }}).inject(this.node, "after");
         input.inject(node);
 
         this.node.destroy();
         this.node = node;
+    },
+
+    _loadNodeEdit: function(){
+        if (!this.json.preprocessing) this._resetNodeEdit();
+        var input = this.node.getFirst();
+        input.set(this.json.properties);
         this.node.set({
             "id": this.json.id,
             "MWFType": this.json.type,
@@ -111,7 +117,7 @@ MWF.xApplication.process.Xform.Textfield = MWF.APPTextfield =  new Class({
                 "styles": this.form.css[this.iconStyle]
             }).inject(this.node, "before");
         }else if( this.form.json.nodeStyleWithhideModuleIcon ){
-            this.node.setStyles(this.form.json.nodeStyleWithhideModuleIcon)
+            this.node.setStyles(this.form.json.nodeStyleWithhideModuleIcon);
         }
 
         this.node.getFirst().addEvent("change", function(){

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

@@ -12,7 +12,7 @@ MWF.xApplication.process.Xform.Tree = MWF.APPTree =  new Class({
 
 
         var treeData = this.json.data;
-        if (this.json.dataType == "script") treeData = this.form.Macro.exec(this.json.dataScript.code, this);
+        if (this.json.dataType == "script") treeData = this.form.Macro.exec(((this.json.dataScript) ? this.json.dataScript.code : ""), this);
 
 		this.tree.load(treeData);
 	},

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

@@ -125,7 +125,7 @@ MWF.xApplication.process.Xform.Widget = MWF.APPWidget =  new Class({
     getWidget: function(callback){
         var method = (this.form.options.mode !== "Mobile" && !layout.mobile) ? "getWidgetByName" : "getWidgetByNameMobile";
         if (this.json.widgetType==="script"){
-            if (this.json.widgetScript.code){
+            if (this.json.widgetScript && this.json.widgetScript.code){
                 var formNome = this.form.Macro.exec(this.json.widgetScript.code, this);
                 if (formNome){
                     var app = this.form.businessData.pageInfor.portal;
@@ -168,7 +168,7 @@ MWF.xApplication.process.Xform.Widget = MWF.APPWidget =  new Class({
         if( this.json.parameterType === "map" ){
             params = this.json.parametersMapList;
         }else if( this.json.parameterType === "script" ){
-            var code = this.json.parametersScript.code;
+            var code = (this.json.parametersScript) ? this.json.parametersScript.code : "";
             if (code){
                 params = this.form.Macro.exec(code, this);
             }