/**
 * MultiSelect校验组件
 * js组件：MultiSelectObj.js
 * 属性：isNullable：是否为空。 当为NO时不可以为空，需要非空校验；当为YES时可以为空，不需要非空校验。
 * 说明：1、非空校验
 *      2、将Enter 键转换为 Tab 键。
 */
 function MultiSelectObj(editerObj){

	//定义输入对象
	this.edtObj = editerObj;


	//公共方法
	this.getParentObj = MSEL_getParentObj;
	this.getBaseObj = MSEL_getBaseObj;

	this.onvalidate = MSEL_onvalidate;

	this.onReady = MSEL_onDocumentReady;
 	this.eventBand = MSEL_eventBand;


	//私有方法

	//私有对象
    var ParObj=null;
    var BasObj=null;
}

 	function MSEL_getParentObj(){
    	if(this.ParObj==null){
    		this.ParObj = new BaseObj(this.edtObj);
    		}
    		return this.ParObj;
   	}
   function MSEL_getBaseObj(){
   	if(this.BasObj==null){
   		this.BasObj = new BaseObj(this.edtObj);
   	}
   	return this.BasObj;

   	}

    function MSEL_onvalidate() {
     //调用BaseObject中的公用函数检查数据合法性
     if(!this.getBaseObj().commonCheck())	return false;
     return true;
    }

function MSEL_onDocumentReady() {
    this.getParentObj().onReady()
}

function MSEL_eventBand(){}


MultiSelectObj.prototype.beforeSubmit = function(){
	if(this.edtObj.disabled){
		this.edtObj.disabled=false;
	}
	if(this.edtObj != null){//保证所有的option都被选中
		for(var i = 0;i < this.edtObj.options.length;i++){
			this.edtObj.options.item(i).selected = true;
		}
	}
	
	this.getParentObj().beforeSubmit();
}
