Chapter 14. Advanced event handling and event busses
This chapter covers
Our first topic in the advanced part of this book is a deeper look at events and event busses.
Before we get to event busses, we’ll reaffirm the brief description from chapter 3 of what events are and then look at how GWT handles the differences between Internet Explorer and standards-compliant browsers in event handling. This is useful because it means we only have to worry about handling events in one way and not how, say, Firefox handles them compared to IE.
We’ll also show how to preview events so you know what event has been raised before any item gets to handle it. Previewing events means you can cancel them if you want, so that they don’t get handled, or you can use the preview to implement keyboard shortcuts in your application. In addition to previewing events, we’ll also look at preventing the browser from doing its default action—for example, if you drag an image to the location bar it will load only that image, which you might not want to happen.