I tried this code:
public class OwnFlowPanel extends FlowPanel implements HasClickHandlers{
public HandlerRegistration addClickHandler(ClickHandler handler) {
return addDomHandler(handler, ClickEvent.getType());
}
}
and then I used this in another class:
OwnFlowPanel panel = new OwnFlowPanel();
panel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("Clicked on object id: "+id);
}
});
This didn't work :(