protected void initListener() {
super.initListener();
beforeListener = new BeforeActionListener(){
@Override
public void beforeAction(BeforeActionEvent event) {
if(event.getType()==BeforeActionEvent.ACTION_ADD_ROW||event.getType()==BeforeActionEvent.ACTION_COPY){
if(CostCenterSetingEditUI.this.prmtcompany.getValue()==null){
MsgBox.showWarning("公司不可为空!");
event.setCancel(true);
}
}
}
};
this.kdtEntrys.setBeforeAction(beforeListener);
kdtEntrys.addKDTEditListener(new KDTEditAdapter()
{
public void editStopped(KDTEditEvent e)
{
try
{
kdtEntrys_Changed(e.getRowIndex(), e.getColIndex());
} catch (Exception exc)
{
handUIException(exc);
}
}
});
}
原文:http://www.cnblogs.com/cyhj/p/4444627.html