It depends on what you're trying to do, Stefan. You'll need to subclass TextBox, then do this:
(1) Add this to the constructor: http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/UIObject.html#sinkEvents(int) http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/Event.html#ONPASTE sinkEvents(Event.ONPASTE); (2) Override this method: http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/Widget.html#onBrowserEvent(com.google.gwt.user.client.Event) @Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); switch (event.getTypeInt()) { case Event.ONPASTE: { // do something here break; } } } N.B.: (1) Opera doesn't fire any cut, copy or paste events, so this won't work in Opera. (2) If you want to find the text that the user is about to paste and do something special with it, this will only be possible in IE or WebKit-based browsers (Safari & Chrome). On Mar 22, 8:38 am, StrongSteve <[email protected]> wrote: > Hi Everybody, > > Is it possible to react on the user pasting text into a GWT textbox? > (Both using STRG+V and using the right-mouse context menu Paste). > > ValueChange, MouseUp, ... are not fired, as I had expected them to > do. :( > > Any ideas? > > Thanks in Advance for your help! > Stefan -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
