I come from the Flex/JS/Tapestry worlds and a technique commonly used is to attach listeners to certain events expecting they'll will go up like a bubble through the component hierarchy. Actually if I'm not wrong this kind of behavior also occurs with native hardware events in GWT.
A typical example is the Accept/Cancel widget. It's a widget because it's repeated all over the application. To reduce coupling to a minimum, I'd like to listen to the events "accept" and "cancel" on the current widget (that contains accept/ cancel directly or indirectly), being aware that if users click "accept" the event will be caught and what you do depends on that context (UI structure) The EventBus is okay, but it doesn't seem to take into account this component hierarchy, all the event handlers are notified without discrimination. I've managed, however, to create a BubbledEvent/BubbledEventHandler that only is dispatched if the current listener (a visual widget) is a parent of that which triggered it. I hope I was clear, Best regards, Juan On Jun 25, 3:34 am, Ashwin Desikan <ashwin.desi...@gmail.com> wrote: > what sort of events are you looking to capture? You can create custom events > and register those events with the eventBus. When ever that event occurs all > handlers would receive a notification and you can take necessary action. > > Thanks > Ashwin -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.