dst.defineClass("com.dst.slms.supplierreview.supplierreview.supplierReviewEdit", dst.framework.coreBillBaseEdit, {
	initalizeDOM:function(){
		com.dst.slms.supplierreview.supplierreview.supplierReviewEdit.superClass.initalizeDOM.call(this);
		var id =$('#reviewType').textbox("getBizValue").id;
		if(!id){
			 $("#reviewTemplate").textbox("readonly", true);
		}
	},
	updateSupplierProfile:function(newValue,oldValue){
		var supplierProid =$('#supplierProfile').textbox("getBizValue").id;
		dst.remoteCall({
			method : "getSupplierProfile",
			async:true,  
			url: "supplierProfileController",
			param : {supplierProid:supplierProid},
			success : function(data, textStatus) {
				if(data.code==200){
					$('#name').textbox("setValue",data.name)
				}else{
					$('#name').textbox("setValue","")
				}
			}
		});
	},
	updatereviewType:function(newValue,oldValue){
		var id =$('#reviewType').textbox("getBizValue").id;
		$('#reviewTemplate').textbox("setFilter"," isEnable='Y' and reviewType.id ='"+id+"'");
		$("#reviewTemplate").textbox("readonly", false);
	},
	updatereviewTemplate:function(newValue,oldValue){
		var id =$('#reviewTemplate').textbox("getBizValue").id;
		var tis = this
		dst.remoteCall({
			method : "getReviewTemplate",
			async:true,  
			url: "supplierReviewController",
			param : {"id":id},
			success : function(data, textStatus) {
				if(data){
					$('#supplierReviewScore-entity').datagrid({
						data: data
					});
				}else{
					$('#supplierReviewScore-entity').datagrid({
						data: []
					});
				}
			}
		});
	}
});