开发者

Click event to a Gwt-connector

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:

  1. Am i doing anything wrong in the code while adding the clickhandler?
  2. I am getting error saying that addDomHandler is开发者_StackOverflow社区 undefined for the type Diagrams. are there limitations for adding click handlers?

Any input will be of great help. Thank you.


You are overriding the fireEvent, whithout firing the event!

You either need to fire the event or remove the method at all.


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.


I was supposed to add the HasClickHandler to Shape class rather than Diagrm. Its working fine now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜