I tried this code below which seems perfectly fine, but it gives me errors on handler.onResize(this) and tell me:
The method onResize(ResizeEvent) in the type ResizeHandler is not applicable for the arguments (new GwtEvent(){})
Here’s my code:
private void update(){
this.fireEvent(new GwtEvent<ResizeHandler>(){
@Override
public com.google.gwt.event.shared.GwtEvent.Type<ResizeHandler> getAssociatedType() {
return new Type<ResizeHandler>();
}
@Override
protected void dispatch(ResizeHandler handler) {
handler.onResize(this);
}
});
}
You should pass in a
new ResizeEvent()and override the methods you need. ResizeHandler’sonResizetakes aResizeEvent, not aGwtEvent.