The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience. (3) [Avatar] Offline
Could some one sweetly explain what does it mean to sink an event?
adam.tacy (269) [Avatar] Offline
Re: What's sinking an event at all?
Best I can come up with....

Think of a fast flowing river with a watertight box sitting in it with the water flowing past, over and under it - that's your widget, sitting in the browser with events (mouse movements, buttons clicking etc) firing all around it.

If you put a hole in the box, then the water can flow in - now you're "sinking events".

OK, so this breaks down a little, as when you sink events you are saying you're only interested in certain parts of the water rather than all of it, but hopefully this makes the point!

Even though you let the water in (sinking events) you need to put something inside the box to use the event otherwise all you have is a wet box. In GWT that means implementing the onBrowserEvent method to handle events that are sunk on a widget.

Hope that somehow helps!

//Adam (3) [Avatar] Offline
Re: What's sinking an event at all?
Thanks, Adam.

Got it: sinking events = making the widget ready for events. I can carry on reading Chapter 6 then