mouseevent - GWT : Difference b/w addMouseOutHandler and addDomHandler -


i want implement onmouseout method hide popup.

what difference b/w 2 approaches..?

1. addmouseouthandler

actionspopup.addmouseouthandler(new mouseouthandler() {                  @override         public void onmouseout(mouseoutevent event) {             actionspopup.hide();         }     });     }); 

2. adddomhandler

 actionspopup.adddomhandler(new mouseouthandler() {                  @override         public void onmouseout(mouseoutevent event) {             actionspopup.hide();         }     });     }, mouseoutevent.gettype()); 

there no real difference. if gwt code of basic widgets (like focuspanel) implementation of addmouseouthandler calls adddomhandler:

public handlerregistration addmouseouthandler(mouseouthandler handler) {     return adddomhandler(handler, mouseoutevent.gettype()); } 

but using hasmouseouthandlers interface, code have more flexibility. example can use @uihandler annotation. or can see widget 'hasmouseouthandlers' instance in order group treatments. way, in signature of object, indicate others developers object can receive type of event.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -