I try to insert new element into RichTextArea but get an exception

"JavaScriptException: (Error): Invalid argument."

    public void onModuleLoad() {
        final RichTextArea editor = new RichTextArea();
        RootPanel.get("editor").add(editor);

        Button button = new Button("Click Here");
        button.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
                Document document =
IFrameElement.as(editor.getElement()).getContentDocument();
                ButtonElement button = document.createButtonElement();
                document.appendChild(button);
            }
        });
        RootPanel.get("buttons").add(button);
    }


...........
[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Invalid
argument.
 number: -2147024809
 description: Invalid argument.
        at com.google.gwt.dom.client.Node$.appendChild$(Native Method)
...........

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to