Firing click event from code in gwt

后端 未结 8 666
甜味超标
甜味超标 2020-12-03 10:27

I have created a custom widget in gwt which extends the composite.I am using focus panel in that.For FocusPanel I added ClickHandler.Then I have added keyboard listner.Now o

相关标签:
8条回答
  • 2020-12-03 11:09

    I haven't done this for a click event, but I've done change events like this.

    NativeEvent event = Document.get().createChangeEvent();
    DomEvent.fireNativeEvent(event, this);
    

    The [createClickEvent](http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/dom/client/Document.html#createClickEvent(int,%20int,%20int,%20int,%20int,%20boolean,%20boolean,%20boolean,%20boolean)) method takes a lot more parameters though.

    public final NativeEvent createClickEvent(int detail,
                                              int screenX,
                                              int screenY,
                                              int clientX,
                                              int clientY,
                                              boolean ctrlKey,
                                              boolean altKey,
                                              boolean shiftKey,
                                              boolean metaKey)
    
    0 讨论(0)
  • 2020-12-03 11:11

    Please notice that the KeyPressHandler doesn't work in Firefox for special keys like ENTER, you would need to use the KeyUp or KeyDown

    http://code.google.com/p/google-web-toolkit/issues/detail?id=5558#c6

    0 讨论(0)
提交回复
热议问题