Saturday, January 1, 2011

How to disable a custom widget and its click handlers

Hi. I'm making a custom button widget.

This button has a setEnabled method. When the button is disabled, clicking on the button must do nothing. How do I achieve this behavior? 

I've tried adding a Click Handler like so, to no avail:

@Override

public void onClick(ClickEvent event) {

if (!isEnabled()) {

event.stopPropagation();

event.preventDefault();

return;

}

}

--
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