Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Lost Focus Event

    Hi,

    Say I have 2 canvases . The user is interacting with a component in Canvas 1 , when he switches to the component in canvas 2 and clicks on it . How do I get track this event , when the focus from Component in Canvas 1 was lost due to focus on a Component in Canvas 2 through a click ?

    #2
    Try this:

    Code:
                    Canvas c;
                    c.addFocusChangedHandler(new FocusChangedHandler() {
                        @Override
                        public void onFocusChanged(FocusChangedEvent event) {
                            event.getHasFocus();
                        }
                    });
    event.getHasFocus() returns true/false (not 100% it will fire for both canvases - one getting and loosing the focus), but in any case, in this event handler you can do whatever you want with the other canvas you're interested in. You can also set the static Canvas activeCanvas somewhere, and act according to it's value.

    Comment

    Working...
    X