通常我们要在一个UI中打开另外一个UI,并传递参数给新UI,最后从新UI取得返回的结果数据。下面以报表项目中打开公式编辑代码为例:
public void actionFormula_actionPerformed(ActionEvent e) throws Exception {
//开始展现UI弹出总公式计项框
IUIWindow window = null;
UIContext uiCtx = new UIContext(this);
uiCtx.put("SUMITEMFORMULA", txtSumItemFormula.getText().toString().trim());
uiCtx.put("rptType",this.RptType.getSelectedItem().toString().trim());
window = UIFactory.createUIFactory(UIFactoryName.MODEL).create((com.kingdee.eas.huar.basedata.client.SumItemFormulaEditUI.class).getName(), uiCtx, null);
window.show();
SumItemFormulaEditUI pickerUI = (SumItemFormulaEditUI)window.getUIObject();
if(pickerUI.isOK()){
txtSumItemFormula.setText(pickerUI.itemText);
}
}