Reputation: 1533
I am trying to add click event to one of the widgets that use gwt-connector. Here is the code:
public class Diagrams extends Diagram implements HasClickHandlers{
public Diagrams(AbsolutePanel boundaryPanel) {
super(boundaryPanel);
}
@Override
public HandlerRegistration addClickHandler(ClickHandler handler) {
return addDomHandler(handler, ClickEvent.getType());
}
@Override
public void fireEvent(GwtEvent<?> event) {
}
}
Here Diagram is a gwt-connector class. Here is the link to the Diagram class and also link to GWT-Connector.
Question:
Any input will be of great help. Thank you.
Upvotes: 1
Views: 582
Reputation: 1533
I was supposed to add the HasClickHandler to Shape class rather than Diagrm. Its working fine now.
Upvotes: 0
Reputation: 14286
You are overriding the fireEvent, whithout firing the event!
You either need to fire the event or remove the method at all.
Upvotes: 1
Reputation: 1
I can not find the source code for this project. I am sure I am missing something. You would be better off putting the Diagram widget inside of say a FocusPanel or some other widget that supports the listeners you want. Also, Diagram is a custom widget. It may not be possible to add a listener to it. But It will be difficult for anyone to answer unless they can see the source code.
Upvotes: 0