Monday, October 31, 2011

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

I was trying to work this out a few months back but gave up.
If anyone has a answer Id be interested too hear as well.

I suspect somehow you have to tie it to the inner iframes DOM, but I
dont know how to do that.
(in fact, not even sure if you can get the inner DOM of a iframe :-/)

On Oct 30, 4:30 pm, Brandon Donnelson <branflake2...@gmail.com> wrote:
> I'm trying to observe the OnPaste Event but can't seem to hook it into the
> RichTextArea and not sure why yet.
>
> http://code.google.com/p/gwt-examples/source/browse/trunk/GoneVertica...
> - 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?
>      */
>     sinkEvents(Event.ONPASTE); // TODO ? no worky
>     DOM.sinkEvents(getElement(), Event.ONPASTE); //TODO ? no worky
>
>     //sinkEvents(Event.ONKEYUP);
>
>     /**
>      * 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("Pasting?????");
>           Window.alert("works");
>         }
>         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?
>
> Thanks
> Brandon Donnelsonhttp://gwt-examples.googlecode.com

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment