Monday, January 31, 2011

Re: Firefox ONPASTE: Get the text to be pasted?

Thanks for posting this!  Very helpful!  I did variation on the theme. 

I created a class called XTextBox (and XTextArea) which catches the ONPASTE and then fires the ValueChangedEvent. This is useful because all I need to do is call the textBox.addValueChangeHandler(aHandler)  in my presenter class. 

public class XTextBox extends TextBox  {

    public XTextBox() {
     * Catch ONPASTE and re-throw it as a ValueChangeEvent
    public void onBrowserEvent(Event event) {
        switch (event.getTypeInt()) {
            case Event.ONPASTE: {
                String newValue = null;  // get the pasted value here!!!
                this.setValue(newValue, true);


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
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