金蝶EAS重写系统组件(CostCenterBizUnitF7)

CostCenterBizUnitF7  是一个树形的F7选择框,用于选择成本中心,支持单选,多选.它和它的兄弟 CostCenterF7NoPerm,在EAS BOS属于系统组件.java


它有一个很不方便的地方:查询的时候默认 编码 ,但一般咱们是根据 名称 .这里经过重写组件来解决问题.this

思路是这样的:反编译 CostCenterBizUnitF7 类,而后在二次开发的类里面  重写一个 同 路径同类名 的类,设置其默认根据 名称 进行查询,系统在运行时优先使用二次开发里面的类.这样就达到目咱们的要求了.编码


实际操做中,经过反编译,发现  CostCenterBizUnitF7,CostCenterF7NoPerm 的默认设置是在 构造方法  spa

com.kingdee.eas.basedata.org.client.OrgF7UI2.OrgF7UI2() 
throws Exception

中实现的,代码以下code

        this.comboField.addItem(ImportCompayFieldsEnum.NUMBER);
        this.comboField.addItem(ImportCompayFieldsEnum.NAME);
        this.comboField.addItem(ImportCompayFieldsEnum.UNITTYPE);
        this.comboField.addItem(ImportCompayFieldsEnum.CODE);
        this.comboField.addItem(ImportCompayFieldsEnum.SIMPLENAME);
        this.comboField.addItem(ImportCompayFieldsEnum.DESRIPTION);
        this.comboField.setSelectedIndex(0);

很显然,咱们只要设置 comboField.setSelectedIndex(1)   便可达到目的.开发


相似的思路还能够用于重写其它的系统组件.it

相关文章
相关标签/搜索