Disable user interaction in a GWT container?

I want to disable / enable user interaction (click the mouse more specifically) in many widgets, such as a hyperlink, button, etc., which are contained in a composite (flextable)

there is more than one click handler, and I don’t want to worry about deleting and adding listeners according to the mode (interaction is on / off)

Any ideas would be appriciated ...

+1
source share
2 answers

You forgot to mention the GWT version. In GWT 2.0 you can use this piece of code or something similar. This function allows you to cancel events before they are transferred to the target widget.

  Event.addNativePreviewHandler (new Event.NativePreviewHandler () {
                 public void onPreviewNativeEvent (NativePreviewEvent pEvent) {
                     final Element target = pEvent.getNativeEvent (). getEventTarget (). cast ();

                     // block all events targetted at the children of the composite.
                     if (DOM.isOrHasChild (getElement (), target)) {
                         pEvent.cancel ();
                     }
                 }
             });
+5
source

There is a GlassPanel component in the google-web-toolkit incubator. I am pretty sure that he does what you need. In any case, it is a good idea to cover a disconnected component with one of them.

+1
source

All Articles