Monday, February 27, 2012

event.stopPropagation()

Hello group,

I defined a header in my StackLayoutPanel as a composition of few
other components (i.e. text node and label inside an HTMLPanel). When
the label is clicked, I would like to stop the mouseUp event from
bubbling to the header, so that the animation is not generated. I've
been googling for few hours and tested such solutions as [1] and [2],
but with no success.

myLabel.addMouseUpHandler(new MouseUpHandler() {
@Override
public void onMouseUp(MouseUpEvent event) {
event.stopPropagation(); //[1]
DOM.eventCancelBubble(DOM.eventGetCurrentEvent(), true); //[2]
}
});

How to overcome such issue? Thanks for help!

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment