/**
 * Radio校验组件
 * js组件：RadioObj.js
 * 属性：isNullable或nullable：是否为空。 当为false时不可以为空，需要非空校验；当为true时可以为空，不需要非空校验。
 * 说明：1、非空校验
 *      	2、将Enter 键转换为 Tab 键。
 */
 function RadioObj(editerObj){
	var myForm=editerObj.form;
	var strScript="myForm."+editerObj.name;
	
	//定义输入对象
	this.edtObj = eval(strScript);


	//公共方法
	this.getParentObj = RADIO_getParentObj;
	this.getBaseObj = RADIO_getBaseObj;

	this.onvalidate = RADIO_onvalidate;

	this.onReady = RADIO_onDocumentReady;
	this.eventBand = RADIO_eventBand;


	//私有方法

	//私有对象
	var ParObj=null;
	var BasObj=null;
}
function RADIO_getParentObj(){
	if(this.ParObj==null){
		this.ParObj = new BaseObj(this.edtObj);
	}
	return this.ParObj;
}
function RADIO_getBaseObj(){
	if(this.BasObj==null){
		this.BasObj = new BaseObj(this.edtObj);
	}
	return this.BasObj;
}

function RADIO_onvalidate() {
	//调用BaseObject中的公用函数检查数据合法性
	if(!this.getBaseObj().commonCheck()){
		return false;
	}
		
	return true;
}

/**
 *名称：onDocumentReady
 *功能：在select中自动增加这项<option value="">请选择</option>
 *形参：
 *
 *返回：
 */
function RADIO_onDocumentReady(){
	//调用父类的初始化方法
	this.getParentObj().onReady()
}

function RADIO_eventBand(){}



RadioObj.prototype.beforeSubmit = function(){
	if(this.edtObj.length){
		for(var i=0; i<this.edtObj.length; i++){
			this.edtObj[i].disabled=false;
		}
	}else{
		this.edtObj.disabled=false;
	}
	this.getParentObj().beforeSubmit();
}
