我有主类DCNotification,它向数据库注册查询。我有一个事件调度程序dispatchCustomEvent。我可以将dispatchCustomEvent表单称为主类。我有一个DatabaseChangeListener类。我无法从DatabaseChangeListener类使事件分派器工作。
DatabaseChangeListener的实例需要2个输入,一个处理程序和一个Event。我可以同时从主类和DatabaseChangeListener类中打印处理程序和事件。但是DatabaseChangeListener类的调用无法正常工作,因为dispatchCustomEvent无法解析处理程序的引用
public class DCNotification extends VBean{
public static IHandler mHandler;
public final static ID pEvent = ID.registerProperty("EVENT");
public DCNotification(){
super();}
public void init(IHandler handler){
super.init(handler);
mHandler = handler;}
private void registerChangeNotification(){
// change notification registration code}
private class DCNotificationDatabaseChangeListener implements DatabaseChangeListener{
DCNotificationDatabaseChangeListener( DCNotification demo ){
super();
this.demo = demo;}
public void onDatabaseChangeNotification(DatabaseChangeEvent e){
// Raise form when-custom_event trigger
// get change details
dispatch_event() ;} //dispatch_event do not work
}
public void dispatch_event(){
CustomEvent ce = new CustomEvent(mHandler,pEvent);
dispatchCustomEvent(ce);}
public void test_dispatch_event(){
dispatch_event();} //dispatch_event works
onDatabaseChangeNotification给出错误 oracle.forms.ui.BeanManager.dispatchCustomEvent(未知来源) oracle.forms.ui.VBean.dispatchCustomEvent(未知来源) 无法解析对mHandler或Event的引用?不确定 感谢您的帮助谢谢