// Changed on 20 May 2006 at 07:02:15 by ZYJ
// 论坛:www.qiuhao.com
// 博客:http://www.qiuhao.com/boke.asp?maxfara.index.html
// 邮箱:Zhouyujie238@hotmail.com
//本函数来自andy的代码
//出处:http://www.qiuhao.com/dispbbs.asp?boardID=2&ID=26&page=2
void lookupItemByItemTypeGroup(FormStringControl lookupCtrl,
ItemGroupId ItemGroupId,ItemType _ItemTYpe=ItemType::BOM)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable), lookupCtrl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource = query.addDataSource(tableNum(InventTable));
QueryBuildRange queryBuildRange = queryBuildDataSource.addRange(fieldNum(InventTable, ItemGroupId));
QueryBuildRange queryBuildRange1 = queryBuildDataSource.addRange(fieldNum(InventTable, ItemType));
;
QueryBuildRange.value(ItemGroupId);
QueryBuildRange1.value(enum2str(_ItemTYpe));
sysTableLookup.addLookupfield(fieldNum(InventTable, ItemId));
sysTableLookup.addLookupfield(fieldNum(InventTable, ItemName));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
edt lookup方法中调用
element.lookupItemByItemTypeGroup(this,'Lamps',ItemType::BOM);
--------------------------------
第二种方法
调用(调用方edt lookup):
public void lookup()
{
Args args = new Args();
FormRun formRun;
;
args = new Args(FormStr('Lookup_LookupForm'));
formRun = classFactory.formRunClass(args);
formRun.init() ;
this.performFormLookup(formRun);
super();
}
lookup窗体只需覆盖closeSelect: (form属性Frame=Border)
public void closeSelect(str _selectString)
{
super(unit.unitid);
}