Skip to content

Instantly share code, notes, and snippets.

@lofidewanto
Last active June 14, 2018 15:28
Show Gist options
  • Save lofidewanto/f71883c529356792b2fe15a39c217579 to your computer and use it in GitHub Desktop.
Save lofidewanto/f71883c529356792b2fe15a39c217579 to your computer and use it in GitHub Desktop.
...
...
Button button = new Button();
button.setType(..);
...
Element th1 = DOM.createTH();
th1.appendChild(button.getElement());
// NOT WORKING: add click event to Button
button.addClickHandler(event -> {
logger.info("OnBrowserEvent: OK");
});
// NOT WORKING: add click event to Button
Element buttonElement = button.getElement();
Event.sinkEvents(buttonElement, Event.ONCLICK);
Event.setEventListener(buttonElement, event -> {
logger.info("OnBrowserEvent: OK");
if (Event.ONCLICK == event.getTypeInt()) {
logger.info("OnBrowserEvent: OK");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment