1DataWindow实现描述
1.1服务器端(java,jsp)函数
1.1.1ASDataObject函数
1.1.1.1New ASDataObject
/*-----用Sql语句生成一个新的DataObject------*/
ASDataObject doTemp = new ASDataObject(sSql);
1.1.1.2setHeader
/*-----将前面所定义的Header加载到DataObject中------*/
(String sHeader);
sSql = "select BusinessNo,SerialNo,ContractType "
+" from GUARANTY_INFO "
+" where BusinessNo='"+sBusinessNo+"'";
ASDataObject doTemp = new ASDataObject(sSql);
doTemp.setHeader(sHeaders);
/*-----设置连续Header,ValueList用,分割------*/
(String sValueList)/*-----设置连续Header,ValueArray[i][0-1] 0:Name 1:Header ------*/
(String[][] sValueArray)
1.1.1.3UpdateTable
/*-----定义在对DataWindow中的数据进行更新操作时所要更新的数据库表------*/
doTemp.UpdateTable = "CUSTOMER_BELONG";
1.1.1.4setAlign
/*-----设置DataWindow中所显示字段对齐格式,对齐方式 1 左、2 中、3 右------*/
Void(String sColumnList, String sFormat)
doTemp.setAlign("SignDate,BeginDate,EndDate,KeepingBeginDate ","2");
1.1.1.5setCheckFormat
/*-----设置DataWindow中字段格式检查类型, 1 String、2 Number、3 Date(yyyy/mm/dd)、4 DateTime(yyyy/mm/dd hh:mm:ss)) ------*/
void(String sColumnList, String sFormat)
doTemp.setCheckFormat("yearh_sum,off_amt,rep_amt,off_sum ","2");
1.1.1.6setColumnAttribute
/*-----设置单个字段属性,”Unit”,”Group” ------*/
boolean
(int iIndex, String sAttributeName, String sAttributeValue)
doTemp.setColumnAttribute("RegisterCapital,PaiclUpCapital,LoanBalance,OverdueBalance,InterestBalance,VouchBalance","Unit","(单位:万元)");
/*-----设置字段属性,sColumnList为""时,为所有字段------*/
boolean(String sColumnList,String sAttributeName,String sAttributeValue)
1.1.1.7setUnit
/*-----设置字段单位属性,也可用来创建自定义的对象-----*/
(String sColumnList, String sUnit)
doTemp.setUnit("LoanBalance","(单位:元)");
doTemp.setUnit("CreditBelong"," ");
1.1.1.8setGroup
/*-----设置字段是否需要Group------*/
(String sColumnList, String sGroupLevel)
sSql = "Select 分行,支行, LoanBalance from sta_mto03_list " ;...
doTemp.setGroup("支行","1");
doTemp.setGroup("分行","2");
1.1.1.9setColumnType
/*-----设置字段类型(1Column、2Computed Field),目前2表示需要做Sum------*/
(String sColumnList, String sColumnType)
doTemp.setColumnType("yearh_sum,off_amt,rep_amt,off_sum,check","2");
1.1.1.10setDDDWCode
/*-----设置指定字段为下拉框,其来源是一个代码表中的一个代码------*/
(String sColumnList, String sCodeName)
doTemp.setDDDWCode("CustomerBelong","CustomerBelong");
1.1.1.11setDDDWSql
/*-----设置指定字段为下拉框,其来源是一个Sql语句------*/
(String sColumnList, String sSql)
doTemp.setDDDWCode("CustomerBelong","selct ItemNo from CODE_LIBRARY where CodeNo=’CustomerBelong’");
1.1.1.12setDDDWCodeTable
/*-----设置指定字段为下拉框,其来源是一个代码列表------*/
setDDDWCodeTable(String sColumnList, String sSql)
String sCodeTable=",,1,集团企业,2,大型企业,3,中型企业,4,小型企业,5,其他h";
doTemp.setDDDWCodeTable("Scope",sCodeTable);
1.1.1.13setLimit
/*-----设置指定字段的最大输入长度限制------*/
(String sColumnList,int iMaxLength)
doTemp.setLimit("OfficeAdd",10);
1.1.1.14setDefaultValue
/*-----设置字段缺省值------*/
(String sColumnList, String sValue)
doTemp.setDefaultValue("CustomerID","20020111001");
1.1.1.15setEditStyle
/*----- 设置字段的编辑属性,编辑形式(1 Text、2 Select、3 Textarea) ------*/
(String sColumnList, String sStyle)
doTemp.setEditStyle("Remark","1");
1.1.1.16setHTMLStyle
/*-----设置字段的CSS显示属性------*/
(String sColumnList, String sStyle)
doTemp.setHTMLStyle("ContractTypeName"," style={width:180px} ");
1.1.1.17setKey
/*-----设置关键字段,即PrimeKey,sColumnList为""时,为所有字段------*/
(String sColumnList, boolean bValue)
doTemp.setKey("CustomerID",true);
1.1.1.18setReadOnly
/*----- 设置只读字段,sColumnList为""时,为所有字段------*/
(String sColumnList, boolean bValue)
doTemp.setReadOnly("CustomerID",true);
1.1.1.19setRequired
/*-----设置必须输入的字段------*/
(String sColumnList, boolean bValue)
doTemp.setRequired("EnterpriseBelong,OfficeTel,CreditBelong,FirstAccountDate",true);
1.1.1.20setType
/*-----设置字段类型 "String","Number" ------*/
(String sColumnList, String sType)
doTemp.setType("yearh_sum,off_amt,rep_amt,off_sum,check","Number");
1.1.1.21setUpdateable
/*-----设置可更新的字段,sColumnList为""时,为所有字段------*/
(String sColumnList, boolean bValue)
doTemp.setType("yearh_sum,off_amt,rep_amt,off_sum,check",false);
1.1.1.22setVisible
/*----- 设置可见字段,sColumnList为""时,为所有字段------*/
(String sColumnList, boolean bValue)
doTemp.setVisible("BusinessNo,SerialNo,ContractType,SigneeType",false);
1.1.2ASDataWindow函数
1.1.2.1New ASDataWindow
/*-----由ASDataObject生成一个新的ASDataWindow------*/
ASDataWindow dwTemp = new ASDataWindow("my",doTemp,Sqlca);
1.1.2.2Style
/*-----属性设置为1:Grid风格、2:FreeForm------*/
dwTemp.Style="1";
1.1.2.3ReadOnly
/*-----属性设置为1: 为只读------*/
dwTemp.ReadOnly = "1";
1.1.2.4ShowSummary
/*-----属性设置为1: 为显示合计------*/
dwTemp.="1";
1.1.2.5setEvent
/*-----用Script函数定义前续和后续事件sEventName:After(Begin)Insert(Update,Delete)------*/
dwTemp.(String sEventName, String sEventScript)
dwTemp.setEvent("AfterUpdate","!CustomerManage.UpdateCustomerName(#CustomerID,#EnterpriseName)");
1.1.2.6genHTMLDataWindow
/*-----生成HTMLDataWindow ------*/
Vector(String sArgsValue)
Vector vTemp = dwTemp.genHTMLDataWindow("'"+sCustomerID+"'");