Sunday, October 30, 2011

I can't get RichTextAre OnPaste Event hooking|sinking to work?

I'm trying to observe the OnPaste Event but can't seem to hook it into the RichTextArea and not sure why yet. - source (snippet below)
     // deal with messy pasting
     * TODO - No Worky - iframe? I see the ook events in the RichTextAreaImpl and how come I can't hook them in here?

(Event.ONPASTE); // TODO ? no worky
.sinkEvents(getElement(), Event.ONPASTE); //TODO ? no worky

     * TODO this won't work either, b/c it won't capture once focued on richtextarea  

Event.addNativePreviewHandler(new NativePreviewHandler() {
public void onPreviewNativeEvent(NativePreviewEvent event) {
NativeEvent ne = event.getNativeEvent();
if (event.getTypeInt() == Event.ONPASTE) {
System.out.println("event.toDebutString()=" + event.toDebugString() + " ne.getType=" + ne.getType() + " ne.toString=" + ne.toString() + " charCode=" + ne.getCharCode() + " key=" + (char)ne.getCharCode());

Has anybody hooked the onpaste event onto richtextarea? 

Brandon Donnelson

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment