日期:2014-05-16  浏览次数:20378 次

EXTJS 表单的 组件filedLable名 组件名 组件值 组成数组 处理变更
前台主要保存程序代码 
var changeEnterpriceArray = new Array();
		  if(this.EnterpriceInfoWin){
		   	var f = this.EnterpriceInfoWin.enterpriceForm.getForm().items.items;
			for(var i=0;i<f.length;i++){
			    if(!Ext.isEmpty(f[i].fieldLabel)&&""!=f[i].getValue()){
			    	if(f[i].name != 'tradeCo'){
			    		var object = new Object();
				        object.modifyOject='EnterpriseInfo';
						object.itemCode = f[i].name ? f[i].name : f[i].hiddenName;
						object.itemName = f[i].fieldLabel.indexOf("<")>-1?f[i].fieldLabel.substring(0,f[i].fieldLabel.indexOf("<")):f[i].fieldLabel;
						object.modifyContent = (typeof f[i].formatDate == "function") ? mySystem.trim(mySystem.dateRender(f[i].getValue())) : f[i].getValue();
						changeEnterpriceArray.push(object);
			    	}
			    }
		 	}
		  }
		  if(this.ManagerWin){
		   	var f1 = this.ManagerWin.managerForm.getForm().items.items;
		   	var f2 = this.ManagerWin.businessForm.getForm().items.items;
		   	var f3 = this.ManagerWin.financialForm.getForm().items.items;
			for(var i=0;i<f1.length;i++){
			    if(!Ext.isEmpty(f1[i].fieldLabel)&&""!=f1[i].getValue()){
			        var object = new Object();
			        object.modifyOject='ManagInfo';
			        object.managerType = A;
					object.itemCode = f1[i].name ? f1[i].name : f1[i].hiddenName;
					object.itemName = f1[i].fieldLabel.indexOf("<")>-1?f1[i].fieldLabel.substring(0,f1[i].fieldLabel.indexOf("<")):f1[i].fieldLabel;
					object.modifyContent = (typeof f1[i].formatDate == "function") ? mySystem.trim(mySystem.dateRender(f1[i].getValue())) : f1[i].getValue();
					changeEnterpriceArray.push(object);
			    }
		 	}
		 	for(var i=0;i<f2.length;i++){
			    if(!Ext.isEmpty(f2[i].fieldLabel)&&""!=f2[i].getValue()){
			        var object = new Object();
			        object.modifyOject='ManagInfo';
			         object.managerType =B;
					object.itemCode = f2[i].name ? f2[i].name : f2[i].hiddenName;
					object.itemName = f2[i].fieldLabel.indexOf("<")>-1?f2[i].fieldLabel.substring(0,f2[i].fieldLabel.indexOf("<")):f2[i].fieldLabel;
					object.modifyContent = (typeof f2[i].formatDate == "function") ? mySystem.trim(mySystem.dateRender(f2[i].getValue())) : f2[i].getValue();
					changeEnterpriceArray.push(object);
			    }
		 	}
	 		for(var i=0;i<f3.length;i++){
			    if(!Ext.isEmpty(f3[i].fieldLabel)&&""!=f3[i].getValue()){
			        var object = new Object();
			        object.modifyOject='ManagInfo';
			        object.managerType = C;
					object.itemCode = f3[i].name ? f3[i].name : f3[i].hiddenName;
					object.itemName = f3[i].fieldLabel.indexOf("<")>-1?f3[i].fieldLabel.substring(0,f3[i].fieldLabel.indexOf("<")):f3[i].fieldLabel;
					object.modifyContent = (typeof f3[i].formatDate == "function") ? mySystem.trim(mySystem.dateRender(f3[i].getValue())) : f3[i].getValue();
					changeEnterpriceArray.push(object);
			    }
		 	}
		  }
       alert(Ext.encode(changeEnterpriceArray));

EnterpriceChangeAction.saveEnterpriceChange(EnterpriceJsonData,Ext.encode(changeEnterpriceArray),function(result, e){
	    	if (!Ext.isEmpty(result)) {
					if (result.success) {
					 	this.mainForm.getForm().findField("applyId").setValue(result.data.appliyId);
					 	this.applyId =result.data.appliyId;
					}
				}
			 mySystem.afterFormUpdate(result,e,'tr-tr');
		}.createDelegate(this))

-----------------后台代码块-----------

后台:根据属性名获取对像的该属性值

InspectionStatistics object = new InspectionStatistics();
		
object.setCustomsCode("5131");
object.setFullName("tttttttt");

Field field = Class.forName("com.gzeport.app.cplatform.to.InspectionStatistics").getDeclaredField("fullName");
field.setAccessible(true);//设置私有变量允许访问
System.out.println(field.get(object));