SmartGWT 2.3 & 2.4
Basically capturing the Event.ONPASTE for RichTextEditor does not work in Firefox. This is because Firefox does not support the paste event for editable content in an iframe (which RichTextEditor uses for editing).
This is basically the code which I am using:
	I need an idea for a workaround to capture the ONPASTE event. Any ideas?
I also need a way to tell the editor to use HTML mode and not CSS mode for Firefox. I assume that would involve dropping out to JavaScript somewhere. See this link about styleWithCSS in
https://developer.mozilla.org/en/rich-text_editing_in_mozilla
Thank you,
Eric Murphy
Booz Allen Hamilton
					Basically capturing the Event.ONPASTE for RichTextEditor does not work in Firefox. This is because Firefox does not support the paste event for editable content in an iframe (which RichTextEditor uses for editing).
This is basically the code which I am using:
Code:
	
	public class MyRichTextEditor extends RichTextEditor {
	
    public MyRichTextEditor() {
        super();
        super.sinkEvents(Event.ONPASTE);
    }
	
    @Override
    public void onBrowserEvent(Event event)
    {
        super.onBrowserEvent(event);
        switch (event.getTypeInt())
        {
            case Event.ONPASTE:
            {
                Window.alert("Pasted event fired");
                event.preventDefault();
                // Code to handle event
                break;
            }
        }
    }
}
I also need a way to tell the editor to use HTML mode and not CSS mode for Firefox. I assume that would involve dropping out to JavaScript somewhere. See this link about styleWithCSS in
https://developer.mozilla.org/en/rich-text_editing_in_mozilla
Thank you,
Eric Murphy
Booz Allen Hamilton

Comment