function CuteEditor_OnCommand

Last post 06-11-2009, 11:37 PM by goh6613. 8 replies.
Sort Posts: Previous Next
  •  06-07-2009, 11:36 PM 52853

    function CuteEditor_OnCommand

    hi
     
    i got 2 cuteEditor in a single page "ceFront and ceBack" and 2 button "btnFront and btnBack" ....
     
    once btnFront is clicked....ceFront is show and ceBack is hide.....when btnBack is clicked, ceBack is show and ceFront is hide....
     
    i wan both of this cuteeditor to call CuteEditor_OnCommand .....
     
    it able to call it when a command is call, but once the button (btnFront or btnBack) is clicked, the CuteEditor_OnCommand  cant funtion anymore......is it because of the page is post back ?
     
    can someone tell me what is this problem ?
     
    thanks
  •  06-08-2009, 1:20 AM 52854 in reply to 52853

    Re: function CuteEditor_OnCommand

    Hi goh6613,
     
    Please try this example
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5.   
    6. <script runat="server">   
    7.   
    8.     protected void button1_Click(object sender, EventArgs e)   
    9.     {   
    10.         editor1.Visible = true;   
    11.         editor2.Visible = !editor1.Visible;   
    12.         editor1.Text = "editor1";   
    13.   
    14.     }   
    15.   
    16.     protected void button2_Click(object sender, EventArgs e)   
    17.     {   
    18.         editor2.Visible = true;   
    19.         editor1.Visible = !editor1.Visible;   
    20.         editor2.Text = "editor2";   
    21.     }   
    22. </script>   
    23.   
    24. <html xmlns="http://www.w3.org/1999/xhtml">   
    25. <head runat="server">   
    26.     <title>Untitled Page</title>   
    27. </head>   
    28. <body>   
    29.     <form id="form1" runat="server">   
    30.         <div>   
    31.             <asp:Button ID="button1" runat="server" Text="ShowEditor1" OnClick="button1_Click" />   
    32.             <asp:Button ID="button2" runat="server" Text="ShowEditor2" OnClick="button2_Click" />   
    33.             <CE:Editor ID="editor1" runat="server" Visible="false">   
    34.             </CE:Editor>   
    35.             <CE:Editor ID="editor2" runat="server" Visible="false">   
    36.             </CE:Editor>   
    37.         </div>   
    38.     </form>   
    39. </body>   
    40. </html>   
    41.   
    42. <script>   
    43. function CuteEditor_OnCommand(editor,command,ui,value)   
    44.         {   
    45.             alert(command);   
    46.             //handle the command by command name,like   
    47. //          if(command=="New")   
    48. //          {   
    49. //          alert("New");   
    50. //              return true;   
    51. //          }   
    52.         }   
    53. </script>  

    Regards,
     
    Ken
  •  06-08-2009, 5:08 AM 52862 in reply to 52854

    Re: function CuteEditor_OnCommand

    hi kenneth,
     
    i tried the example above, it did not work
     
    but when i set like this
     
    <CE:Editor ID="editor1" runat="server"> </CE:Editor>  
    <CE:Editor ID="editor2" runat="server" Visible="false"></CE:Editor> 
     
    it work for editor1, but after button is clicked, both also din work
     
    may i know how to solve this problem ?
     
    thanks
  •  06-09-2009, 3:58 AM 52884 in reply to 52862

    Re: function CuteEditor_OnCommand

    hi
     
    anyone know how to solve this ?
     
    thanks
  •  06-09-2009, 11:53 AM 52898 in reply to 52884

    Re: function CuteEditor_OnCommand

    Hi All,
     
    I have the similar issue, I cant get the client event (CuteEditor_OnCommand) to fire at all. I coped the "How To" page into my project and it doesnt work?
     
    I am trying to load and save the editor content through ajax, I have the editor working in a modal dialog and loading content through a WCF service, I just need to catch the 'Save' event so I can save the content with out a postback.
     
    Just to let anyone know, the "Live Support" isnt really a support line, they just redirect you here without acyually trying to understand the problem, it should really just be a sales chat.
     
    Any ideas? All comment appreciated.
     
     
     
     
     

    Mark Redman
    Made4Print Limited
    Filed under:
  •  06-09-2009, 12:36 PM 52905 in reply to 52898

    Re: function CuteEditor_OnCommand

    Quick update:
     
    The line of code in the command event in the  "How To" should  be:
     

    if(command.toLowerCase()=="postback" &&value=="Save" && editor.id=="<%=Editor2.ClientID %>")

    This now work in my project, but still have an issue with the command not firing.
    Using the latest version and all code is within a User Control?

    Mark Redman
    Made4Print Limited
  •  06-11-2009, 7:59 PM 53040 in reply to 52905

    Re: function CuteEditor_OnCommand

    hi
     
    for my problem, if i include just a single cuteeditor in my page, the 'oncommand' function can be call perfectly.
     
    so i wonder if i include 2 cuteeditor in a single page, will it confuse which editor call the 'oncommand', if like this how can i set it so that both editor able to call the 'oncommand' ?
     
    thanks
  •  06-11-2009, 10:28 PM 53049 in reply to 53040

    Re: function CuteEditor_OnCommand

    Hi goh6613,
     
    Can you sent me an example can reproduce this issue and the steps?
     
     
     
    Regards,
     
    Ken
  •  06-11-2009, 11:37 PM 53053 in reply to 53049

    Re: function CuteEditor_OnCommand

    hi kenneth
     
    i sent the example to ur email already.
     
    thanks a lot
View as RSS news feed in XML