i need to register a cross platform and version independent click event to the document. that means i have a two text box and submit button but when i click outside of the two text box and submit button then alert will be displayed .how can i achive this by gwt
document.get().addMouseClick ???
The easiest way that comes to mind is to wrap everything in a
FocusPanel
:The downside is that you need to assign
ClickHandler
s to every element you don't want an alert for (you can use the sameClickHandler
for that to save memory - like I did above). Other than that, theFocusPanel
implementation should ensure that the onclick behavior stays cross-browser.