0
votes

I have got several Composite and I would like to add an Handler to one of them which fire an event if the user open this composite. Is there any Handler for?

Thank you

1

1 Answers

0
votes

A good/easy way to fire events is by the use of the GQuery library, which emulates JQuery in GWT code. It allows you to do things like:

$(yourWidget).blur();

to fire a blur event on yourWidget, for example... if you don't mind adding a dependency to GQuery to your project, this is the way to go in my opinion. You can even provide a Function which will be called after the event has fired, as in:

$(yourWidget).click(new Function() {
  public boolean f(Event e) {
    e.preventDefault();
    return false;
  }
}

I am not sure how you would do that in pure GWT, but it's obviously possible... you may want to see how GQuery does that.

http://code.google.com/p/gwtquery/