1、监听表头的F7
监听:
prmtcontract.addDataChangeListener(new DataChangeListener() {
public void dataChanged(DataChangeEvent e) {
try {
prmtcontract_Changed();
}
catch (Exception exc) {
handUIException(exc);
}
}
});
赋值:
public void prmtcontract_Changed() throws Exception
{
System.out.println("prmtcontract_Changed() Function is executed!"); txtcontractStatus.setText(UIRuleUtil.getString(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"contractStatus.name")));
txtbusinessOrg.setText(UIRuleUtil.getString(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"businessOrg.name")));
txtagency.setText(UIRuleUtil.getString(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"agency.name")));
txtbussPerson.setText(UIRuleUtil.getString(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"prjManager.name")));
txtagentOfLessor.setText(UIRuleUtil.getString(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"lessorCust")));
txtagentOfLessee.setText(UIRuleUtil.getString(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"lessee")));
txtestimateCapital.setValue(UIRuleUtil.getBigDecimal(UIRuleUtil.getProperty((IObjectValue)prmtcontract.getData(),"esitmateCapital")));
}
2、监听分录上的F7
监听:
kdtEntrys.addKDTEditListener(new KDTEditAdapter() {
public void editStopped(KDTEditEvent e) {
try {
kdtEntrys_Changed(e.getRowIndex(),e.getColIndex());
}
catch (Exception exc) {
handUIException(exc);
}
}
});
赋值:
public void kdtEntrys_Changed(int rowIndex,int colIndex) throws Exception
{
if ("contract".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())) {
kdtEntrys.getCell(rowIndex,"lessee").setValue(UIRuleUtil.getString(com.kingdee.bos.ui.face.UIRuleUtil.getProperty((com.kingdee.bos.dao.IObjectValue)kdtEntrys.getCell(rowIndex,"contract").getValue(),"lessee")));
}