I have some troubles understanding event bubbling and GWT. 

Let's assume I have following structure: 

<g:HTMLPanel>
    <div>
       <span>Text</span>
   </div>
</g:HTMLPanel>

When I want to handle click events on the elements nested in the HTMLPanel 
I add a DOM handler to the HTMLPanel: 


HTMLPanel.addDomHandler(new ClickHandler() {

    @Override
    public void onClick(ClickEvent event) {
        Element target = event.getNativeEvent().getEventTarget().cast();
    }

}, ClickEvent.getType());

My expectation is that if I click on the the div element the onClick method 
is called once with the target set to the div element. If I click on the 
span element I expect the onClick method to be called twice, once with the 
target set to div and another time set to the span element. 

However that doesn't work. When I click on the span element the onClick is 
only called once with the target set to the span element. Shouldn't the 
onClick method be called twice? 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/SyXvBjjKnq4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to