第一个问题方法有好多,介绍一个。,两个字段使用相同的数据子窗口
itemchanged 中
datawindowchild ldwc_model
string item_name
if dwo.name = "rec_name" then
this.getchild("rec_name",ldwc_model)
item_name = ldwc_model.object.item_name[ldwc_model.getrow()]
//通过取得的信息,用sql语句获得要的信息。
//通过setitem,或.object.cloumn[]直接赋值。
end if
//完毕
第二个问题。
retrieve参数不能屏蔽,可以动态修改sql语句。或添入'%'(前提是表达式用的是 like 而不是 = )
this.accepttext()
if dwo.name = "vw_type_type1" then//一级分类的字段
s_type1 = data
this.getchild("vw_type_type2",ldwc2)//二级分类的字段
this.setitem(this.getrow(),"vw_type_type2","")
s_sql="Select distinct type2,type2_code From vw_type Where type1_code = "+"'"+s_type1+"'"
ldwc2.settransobject(sqlca)
ldwc2.SetSQLSelect(s_sql)
ldwc2.retrieve()
end if
我一直在用.