Browse Source

Merge branch 'fix/Process.org_events' into 'develop'

Merge of fix/【流程管理】弹出选择组件增加不显示右侧已选区域的选项,增加expand/collapse事件 to develop

See merge request o2oa/o2oa!790
蔡祥熠 5 years ago
parent
commit
78580bdaf2

+ 29 - 19
o2web/source/x_component_Selector/Person.js

@@ -27,6 +27,7 @@ MWF.xApplication.Selector.Person = new Class({
         "hasShuttle" : false, //穿梭按钮
         "searchbarInTopNode" : true, //搜索框在标题上还是另起一行
         "hasSelectedSearchbar" : false, //已选是不是有搜索框
+        "noSelectedContainer" : false, //是否隐藏右侧已选区域
         "contentUrl" : "", //和默认的页面布局不一样的话,可以传入页面布局HTML URL
         "injectToBody" : false, //当传入HTML URL的时候是否插入到document.body, false的时候插入到this.container
 
@@ -196,7 +197,7 @@ MWF.xApplication.Selector.Person = new Class({
 
             //  this.container.setStyle("z-index", this.options.zIndex);
             this.node = new Element("div", {
-                "styles": this.css.containerNode, //(this.options.count.toInt()===1) ? this.css.containerNodeSingle : this.css.containerNode,
+                "styles": this.options.noSelectedContainer ? this.css.containerNodeSingle : this.css.containerNode, //(this.options.count.toInt()===1)
                 "events": {
                     "click": function(e){e.stopPropagation();},
                     "mousedown": function(e){e.stopPropagation();},
@@ -337,7 +338,7 @@ MWF.xApplication.Selector.Person = new Class({
 
         if (this.selectNode) this.selectNode.setStyles(this.css.selectNodeMobile);
         if (this.searchInputDiv) this.searchInputDiv.setStyles(this.css.searchInputDiv);
-        if (this.searchInput) this.searchInput.setStyles( (this.options.count.toInt()===1) ? this.css.searchInputSingle : this.css.searchInput );
+        if (this.searchInput) this.searchInput.setStyles( (this.options.count.toInt()===1 || this.options.noSelectedContainer) ? this.css.searchInputSingle : this.css.searchInput );
         if (this.letterAreaNode) this.letterAreaNode.setStyles(this.css.letterAreaNode);
         if (this.itemAreaScrollNode) this.itemAreaScrollNode.setStyles(this.css.itemAreaScrollNode);
         if (this.itemAreaNode) this.itemAreaNode.setStyles(this.css.itemAreaNode);
@@ -571,7 +572,7 @@ MWF.xApplication.Selector.Person = new Class({
             "styles": this.css.searchInputDiv
         }).inject(this.selectNode);
         this.searchInput = new Element("input.searchInput", {
-            "styles": (this.options.count.toInt()===1) ? this.css.searchInputSingle : this.css.searchInput,
+            "styles": (this.options.count.toInt()===1 || this.options.noSelectedContainer) ? this.css.searchInputSingle : this.css.searchInput,
             "type": "text"
         }).inject(this.searchInputDiv);
         var width = size.x-20-18;
@@ -925,6 +926,10 @@ MWF.xApplication.Selector.Person = new Class({
             "styles": this.css.selectedContainerNode
         }).inject(this.contentNode);
 
+        if( this.options.noSelectedContainer ){
+            this.selectedContainerNode.hide();
+        }
+
         //if( this.options.embedded && this.options.count.toInt()!==1 ){
         if( this.options.hasTop ){
             this.selectedTopNode = new Element("div",{
@@ -1354,6 +1359,7 @@ MWF.xApplication.Selector.Person = new Class({
         }
     },
     setSize : function(){
+
         if( !this.options.width && !this.options.height )return;
 
         var getOffsetX = function(node){
@@ -1417,7 +1423,9 @@ MWF.xApplication.Selector.Person = new Class({
 
             //if (this.options.count.toInt() !== 1){
             var width = nodeWidth - getOffsetX(this.selectNode) - getOffsetX(this.selectedContainerNode);
-            var halfWidth = Math.floor(width / 2);
+
+            var halfWidth = this.options.noSelectedContainer ? width : Math.floor(width / 2);
+
             this.selectNode.setStyle("width", halfWidth);
             //this.searchInput.setStyle("width", halfWidth - 6);
             if(this.letterAreaNode ){
@@ -1657,7 +1665,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
         this.actionNode = new Element("div", {
             "styles": this.selector.css.selectorItemActionNode
         }).inject(this.node);
-        if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+        if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
             this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
         }
 
@@ -1726,7 +1734,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
         this.checkTextNodeIndent( this.textNode, this.selector.css.selectorItemTextNode_selected );
 
         this.actionNode.setStyles(this.selector.css.selectorItemActionNode_selected);
-        if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
+        if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected  ){
             this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
         }
     },
@@ -1763,7 +1771,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
         }
         if (!this.isSelected){
             this.actionNode.setStyles(this.selector.css.selectorItemActionNode_over);
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_over  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_over  ){
                 this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_over );
             }
         }else if( this.selector.css.selectorItemActionNode_over_force ){
@@ -1778,12 +1786,12 @@ MWF.xApplication.Selector.Person.Item = new Class({
         }
         if (!this.isSelected){
             this.actionNode.setStyles(this.selector.css.selectorItemActionNode);
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
                 this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
             }
         }else if( this.selector.css.selectorItemActionNode_over_force ){
             this.actionNode.setStyles(this.selector.css.selectorItemActionNode_selected);
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected  ){
                 this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
             }
         }
@@ -1801,7 +1809,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
                 this.checkTextNodeIndent( this.textNode, this.selector.css.selectorItemTextNode_selected );
 
                 this.actionNode.setStyles(this.selector.css.selectorItemActionNode_selected);
-                if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
+                if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected  ){
                     this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
                 }
 
@@ -1825,7 +1833,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
         this.checkTextNodeIndent( this.textNode, this.selector.css.selectorItemTextNode );
 
         this.actionNode.setStyles(this.selector.css.selectorItemActionNode);
-        if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+        if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
             this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
         }
         this.selector.fireEvent("unselectItem",[this])
@@ -1846,7 +1854,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
                 this.checkTextNodeIndent( this.textNode, this.selector.css.selectorItemTextNode_selected );
 
                 this.actionNode.setStyles(this.selector.css.selectorItemActionNode_selected);
-                if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
+                if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected  ){
                     this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
                 }
             }
@@ -1868,7 +1876,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
             this.checkTextNodeIndent( this.textNode, this.selector.css.selectorItemTextNode );
 
             this.actionNode.setStyles(this.selector.css.selectorItemActionNode);
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
                 this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
             }
         }
@@ -1895,7 +1903,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
                     this.checkTextNodeIndent( itemSearch.textNode, this.selector.css.selectorItemTextNode );
 
                     itemSearch.actionNode.setStyles(this.selector.css.selectorItemActionNode);
-                    if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+                    if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
                         itemSearch.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
                     }
                 }
@@ -1914,7 +1922,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
                     this.checkTextNodeIndent( item.textNode, this.selector.css.selectorItemTextNode );
 
                     item.actionNode.setStyles(this.selector.css.selectorItemActionNode);
-                    if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+                    if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
                         item.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
                     }
                 }
@@ -1963,7 +1971,7 @@ MWF.xApplication.Selector.Person.ItemSelected = new Class({
     postLoad : function(){
         if( this.selector.css.selectorSelectedItemActionNode ){
             this.actionNode.setStyles( this.selector.css.selectorSelectedItemActionNode );
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorSelectedItemActionNode_single  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorSelectedItemActionNode_single  ){
                 this.actionNode.setStyles( this.selector.css.selectorSelectedItemActionNode_single );
             }
         }
@@ -2000,7 +2008,7 @@ MWF.xApplication.Selector.Person.ItemSelected = new Class({
                 this.node.setStyles(this.selector.css.selectorItem_over);
             }
             this.actionNode.setStyles(this.selector.css.selectorItemActionNode_selected_over);
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected_over  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected_over  ){
                 this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected_over );
             }
         }
@@ -2015,13 +2023,13 @@ MWF.xApplication.Selector.Person.ItemSelected = new Class({
         if (!this.isSelected){
             var styles = this.selector.css.selectorSelectedItemActionNode || this.selector.css.selectorItemActionNode;
             this.actionNode.setStyles(styles);
-            if( this.selector.options.count.toInt() === 1 &&
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) &&
                 ( this.selector.css.selectorSelectedItemActionNode_single || this.selector.css.selectorItemActionNode_single )  ){
                 this.actionNode.setStyles( this.selector.css.selectorSelectedItemActionNode_single || this.selector.css.selectorItemActionNode_single );
             }
         }else if( this.selector.css.selectorItemActionNode_over_force ){
             this.actionNode.setStyles(this.selector.css.selectorItemActionNode_selected);
-            if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single_selected  ){
+            if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected  ){
                 this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected );
             }
         }
@@ -2387,6 +2395,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
             if (!this.fx.isRunning()){
                 var display = this.children.getStyle("display");
                 if (display === "none"){
+                    this.selector.fireEvent("expand", [this] );
                     this.children.setStyles({
                         "display": "block",
                         "height": "0px"
@@ -2395,6 +2404,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
                     this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_expand);
                     this.isExpand = true;
                 }else{
+                    this.selector.fireEvent("collapse", [this] );
                     if (!this.childrenHeight) this.childrenHeight = this.children.getStyle("height").toFloat();
                     this.fx.start("height", ""+this.childrenHeight+"px", "0px").chain(function(){
                         this.children.setStyles({

+ 5 - 3
o2web/source/x_component_Selector/Unit.js

@@ -195,7 +195,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({
         this.actionNode = new Element("div", {
             "styles": this.selector.css.selectorItemActionNode
         }).inject(this.node);
-        if( this.selector.options.count.toInt() === 1 && this.selector.css.selectorItemActionNode_single  ){
+        if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single  ){
             this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
         }
 
@@ -232,9 +232,9 @@ MWF.xApplication.Selector.Unit.Item = new Class({
         debugger;
         if( !this.selector.options.expandSubEnable )return;
         this.isExpand = (this.selector.options.expand);
-        if ( this._hasChild() ){
+        if ( this._hasChild() || this.selector.options.expandEmptyCategory ){
             if (this.selector.options.expand){
-                if (this.level===1){
+                if (this.level===1 && this._hasChild() ){
                     this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand);
                     this.loadSubItems();
                 }else{
@@ -246,10 +246,12 @@ MWF.xApplication.Selector.Unit.Item = new Class({
             }
             this.levelNode.addEvent("click", function(e){
                 if (this.isExpand){
+                    this.selector.fireEvent("collapse", [this] );
                     this.children.setStyle("display", "none");
                     this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_collapse);
                     this.isExpand = false;
                 }else{
+                    this.selector.fireEvent("expand", [this] );
                     this.loadSubItems();
                     this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand);
                     this.isExpand = true;

+ 2 - 0
o2web/source/x_component_Selector/UnitWithType.js

@@ -141,10 +141,12 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({
             }
             this.levelNode.addEvent("click", function(e){
                 if (this.isExpand){
+                    this.selector.fireEvent("collapse", [this] );
                     this.children.setStyle("display", "none");
                     this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_collapse);
                     this.isExpand = false;
                 }else{
+                    this.selector.fireEvent("expand", [this] );
                     this.loadSubItems();
                     this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand);
                     this.isExpand = true;

+ 9 - 8
o2web/source/x_component_Template/Selector/Custom.js

@@ -59,6 +59,7 @@ MWF.xApplication.Template.Selector.Custom = new Class({
     },
     initialize: function (container, options) {
         this.setOptions(options);
+
         this.path = "../x_component_Selector/$Selector/";
         this.cssPath = "../x_component_Selector/$Selector/" + this.options.style + "/css.wcss";
         this._loadCss(true);
@@ -68,7 +69,6 @@ MWF.xApplication.Template.Selector.Custom = new Class({
         this.categorys = [];
     },
     loadSelectItems: function (addToNext) {
-
         debugger;
         if (!this.options.category) {
             this.options.selectableItems.each(function (it) {
@@ -82,8 +82,8 @@ MWF.xApplication.Template.Selector.Custom = new Class({
                 if (item.isItem) {
                     var item = this._newItem(item, this, this.itemAreaNode);
                     this.items.push(item);
-                }
-                if ( (item.subItemList && item.subItemList.length > 0) || item.subCategoryList && item.subCategoryList.length > 0 ) {
+                }else{
+                    // if ( (item.subItemList && item.subItemList.length > 0) || item.subCategoryList && item.subCategoryList.length > 0 ) {
                     if( this.options.categorySelectable ){
                         var category = this._newItemCategorySelectable(item, this, this.itemAreaNode);
                         this.categorys.push( category );
@@ -91,11 +91,12 @@ MWF.xApplication.Template.Selector.Custom = new Class({
                         var category = this._newItemCategory(item, this, this.itemAreaNode);
                         this.categorys.push( category );
                     }
-                    // item.subItemList.each(function (subItem, index) {
-                    //     var item = this._newItem(subItem, this, category.children, 2, category);
-                    //     this.items.push(item);
-                    //     category.subItems.push(item);
-                    // }.bind(this));
+                        // item.subItemList.each(function (subItem, index) {
+                        //     var item = this._newItem(subItem, this, category.children, 2, category);
+                        //     this.items.push(item);
+                        //     category.subItems.push(item);
+                        // }.bind(this));
+                    // }
                 }
             }.bind(this));
         }

+ 15 - 1
o2web/source/x_component_portal_PageDesigner/Module/Page.js

@@ -790,7 +790,21 @@ MWF.xApplication.portal.PageDesigner.Module.Page = MWF.PCPage = new Class({
             MWF.FormImport.create("office", this);
         }.bind(this));
     },
-
+	deletePropertiesOrStyles: function(name, key){
+		if (name=="styles"){
+			try{
+				if( key && this.json.styles[key] ){
+					delete this.json.styles[key];
+				}
+				this.setCustomStyles();
+			}catch(e){}
+		}
+		if (name=="properties"){
+			try{
+				this.node.removeProperty(key);
+			}catch(e){}
+		}
+	},
 	setPropertiesOrStyles: function(name){
 		if (name==="styles"){
 			this.setCustomStyles();

+ 40 - 0
o2web/source/x_component_process_FormDesigner/Module/Org/template.json

@@ -92,6 +92,46 @@
 		"blur": {
 			"code": "",
 			"html": ""
+		},
+		"queryLoadSelector" : {
+			"code": "",
+			"html": ""
+		},
+		"postLoadSelector" : {
+			"code": "",
+			"html": ""
+		},
+		"queryLoadCategory" : {
+			"code": "",
+			"html": ""
+		},
+		"postLoadCategory" : {
+			"code": "",
+			"html": ""
+		},
+		"selectCategory": {
+			"code": "",
+			"html": ""
+		},
+		"unselectCategory": {
+			"code": "",
+			"html": ""
+		},
+		"queryLoadItem" : {
+			"code": "",
+			"html": ""
+		},
+		"postLoadItem" : {
+			"code": "",
+			"html": ""
+		},
+		"selectItem" : {
+			"code": "",
+			"html": ""
+		},
+		"unselectItem" : {
+			"code": "",
+			"html": ""
 		}
 	},
 	"properties": {},

+ 1 - 1
o2web/source/x_component_process_Work/Processor.js

@@ -451,7 +451,7 @@ MWF.xApplication.process.Work.Processor = new Class({
         }
 
         //临时添加
-        if(this.form.data.json.events.afterSelectRoute){
+        if(this.form.data.json.events && this.form.data.json.events.afterSelectRoute){
             this.form.Macro.exec(this.form.data.json.events.afterSelectRoute.code, node);
         }
 

+ 44 - 7
o2web/source/x_component_process_Xform/Org.js

@@ -6,6 +6,8 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
     Extends: MWF.APP$Input,
     options: {
         "moduleEvents": ["load", "queryLoad", "postLoad", "change", "select"],
+        "selectorEvents" : ["queryLoadSelector","postLoadSelector","postLoadContent","queryLoadCategory","postLoadCategory",
+            "selectCategory", "unselectCategory","queryLoadItem","postLoadItem","selectItem", "unselectItem","change"],
         "readonly": true
     },
 
@@ -141,6 +143,8 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
 
     getOptions: function(){
 
+        var _self = this;
+
         if( this.selectTypeList.length === 0 )return false;
 
         var values = this.getInputData();
@@ -215,6 +219,30 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         //    }
         //}
 
+        var defaultOpt = {};
+
+        if( this.json.events && typeOf(this.json.events) === "object" ){
+            Object.each(this.json.events, function(e, key){
+                if (e.code){
+                    if (this.options.selectorEvents.indexOf(key)!==-1){
+                        if( key === "postLoadSelector" ) {
+                            this.addEvent("loadSelector", function (selector) {
+                                return this.form.Macro.fire(e.code, selector);
+                            }.bind(this))
+                        }else if( key === "queryLoadSelector"){
+                            defaultOpt["onQueryLoad"] = function(target){
+                                return this.form.Macro.fire(e.code, target);
+                            }.bind(this)
+                        }else{
+                            defaultOpt["on"+key.capitalize()] = function(target){
+                                return this.form.Macro.fire(e.code, target);
+                            }.bind(this)
+                        }
+                    }
+                }
+            }.bind(this));
+        }
+
         if( this.selectTypeList.length === 1 ){
             return Object.merge( {
                 "type": this.selectTypeList[0],
@@ -222,9 +250,13 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
                     this.selectOnComplete(items);
                 }.bind(this),
                 "onCancel": this.selectOnCancel.bind(this),
-                "onLoad": this.selectOnLoad.bind(this),
+                // "onLoad": this.selectOnLoad.bind(this),
+                "onLoad": function(){
+                    //this 为 selector
+                    _self.selectOnLoad(this, this.selector );
+                },
                 "onClose": this.selectOnClose.bind(this)
-            }, identityOpt || unitOpt || groupOpt )
+            }, defaultOpt, identityOpt || unitOpt || groupOpt )
         }else if( this.selectTypeList.length > 1 ){
             var options = {
                 "type" : "",
@@ -233,15 +265,19 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
                     this.selectOnComplete(items);
                 }.bind(this),
                 "onCancel": this.selectOnCancel.bind(this),
-                "onLoad": this.selectOnLoad.bind(this),
+                // "onLoad": this.selectOnLoad.bind(this),
+                "onLoad": function(){
+                    //this 为 selector
+                    _self.selectOnLoad(this)
+                },
                 "onClose": this.selectOnClose.bind(this)
             };
             if( this.form.json.selectorStyle ){
                 options = Object.merge( options, this.form.json.selectorStyle );
             }
-            if( identityOpt )options.identityOptions = identityOpt;
-            if( unitOpt )options.unitOptions = unitOpt;
-            if( groupOpt )options.groupOptions = groupOpt;
+            if( identityOpt )options.identityOptions = Object.merge( {}, defaultOpt, identityOpt );
+            if( unitOpt )options.unitOptions =  Object.merge( {}, defaultOpt, unitOpt );
+            if( groupOpt )options.groupOptions = Object.merge( {}, defaultOpt, groupOpt );
             return options;
         }
 
@@ -288,8 +324,9 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
     selectOnCancel: function(){
         this.validation();
     },
-    selectOnLoad: function(){
+    selectOnLoad: function( selector ){
         if (this.descriptionNode) this.descriptionNode.setStyle("display", "none");
+        this.fireEvent("loadSelector", [selector])
     },
     selectOnClose: function(){
         v = this._getBusinessData();