14.1. Understanding events
Because you’re this far into the book, we’re going to assume you’re familiar with adding event handlers to widgets and panels (back in section 3.7 we discussed this). You’ve probably written code similar to the following:
Button save = new Button("Save"); save.addClickHandler(new ClickHandler(){ public void onClick(ClickEvent event){ Window.alert("Saving"); } });
Or you may have used the UiBinder equivalent, such as the following:
@UiHandler("save") void saveInformation(ClickEvent event){ Window.alert("Saving"); }
If you add two event handlers for the same event to a widget, they’re fired in the order in which they’re added.
In the UiBinder approach, the ordering is taken from the order ...
Get GWT in Action, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.