Call to Paste, PasteText and Pasteword insert action name, not content

Last post 12-29-2006, 12:28 PM by fredd. 4 replies.
Sort Posts: Previous Next
  •  12-28-2006, 9:22 PM 25423

    Call to Paste, PasteText and Pasteword insert action name, not content

    This js call:
     
    cuteEditor1.ExecCommand("PasteText",false,"PasteText");
     
    Inserts the word "PasteText" in the body of the editor.
     
    If I click the Paste plain text button on the toolbar, the correct content is inserted.
     
    The same thing applies to Paste and PasteWord.
     
    What am I doing wrong?
     
     
     
     
  •  12-28-2006, 9:41 PM 25426 in reply to 25423

    Re: Call to Paste, PasteText and Pasteword insert action name, not content

    You should use PasteHTML
     

    PasteHTML()

    This method is used for pasting the specified HTML into a range within a editor document. If anything is selected, the selection is replaced with the new HTML and text.

    Example:

    // get the cute editor instance
    var editor1 = document.getElementById('<% = Editor1.ClientID%>');

    // pasting the specified HTML into a range within a editor document
    editor1.pasteHTML("Hello World");

     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-28-2006, 10:55 PM 25428 in reply to 25426

    Re: Call to Paste, PasteText and Pasteword insert action name, not content

    You are not addressing the problem...
     
    I am trying to paste information contained in clipboard into the editor.
     
    How can I use PasteHTML to paste from clipboard?
     
    Please read what I said:
     

     
    cuteEditor1.ExecCommand("PasteText",false,"PasteText");
     
    Inserts the word "PasteText" in the body of the editor.
     
    If I click the Paste plain text button on the toolbar, the correct content is inserted.
     
    The same thing applies to Paste and PasteWord.
     

    I need to paste Word and other memorized information into the editor and I would like to use the proper functions. Those functions are described in your documentation as: Paste, PasteText and PasteWord. Your documentation also says the proper way to call them is to use the ExecCommand function.
     
    I ask again: why does clicking the buttons on the toolbar perform the function properly but when I use the ExecCommand function, they don't?
     
     
  •  12-29-2006, 9:56 AM 25434 in reply to 25428

    Re: Call to Paste, PasteText and Pasteword insert action name, not content

    >>why does clicking the buttons on the toolbar perform the function properly but when I use the ExecCommand function, they don't?
     
    It should work. Please use the following code:

        // get the cute editor instance
        var editor1 = document.getElementById('<%=Editor1.ClientID%>');
        
        editor1.ExecCommand("PasteText");
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-29-2006, 12:28 PM 25438 in reply to 25434

    Re: Call to Paste, PasteText and Pasteword insert action name, not content

    This appears to be a bug.
     
    I now have to test the commands before executing them:
     
     if (cmd=="Paste" || cmd=="PasteText" || cmd=="PasteWord") { cuteEditor1.ExecCommand(cmd); } else { cuteEditor1.ExecCommand(cmd,false,val); }
     
    Are there any other commands subject to this bug?
View as RSS news feed in XML