1.定义自己的处理类
public class MyQueryProcessor extends FMDefaultQueryProcessor {
@Override
public void process() throws Exception{
super.process();
String field = getField();
if(field.equals("company.name")){
Object editor = getEditor();
if(editor instanceof KDBizPromptBox) {
KDBizPromptBox prmtBox = (KDBizPromptBox) editor;
/*prmtBox.setQueryInfo("com.kingdee.eas.ma.budget.MyCompanyOrgUnitQuery");
EntityViewInfo evi=new EntityViewInfo();
FilterInfo filterInfo=new FilterInfo();
filterInfo.getFilterItems().add(new FilterItemInfo("isCostOrgUnit",1, CompareType.EQUALS));
filterInfo.getFilterItems().add(new FilterItemInfo("isCompanyOrgUnit",1, CompareType.EQUALS));
evi.setFilter(filterInfo);
prmtBox.setEntityViewInfo(evi);*/
prmtBox.setSelector(new com.kingdee.eas.ma.budget.client.BgCompanyF7());
}
}
}
}
2.在ListUI中重写initCommonQueryDialog方法
@Override
protected CommonQueryDialog initCommonQueryDialog() {
CommonQueryDialog queryDlg = super.initCommonQueryDialog();
queryDlg.setProcessor(new MyQueryProcessor());
return queryDlg;
}