What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

Last post 03-06-2008, 10:12 AM by Adam. 3 replies.
Sort Posts: Previous Next
  •  01-25-2008, 6:46 AM 36553

    What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

    Is there anywhere that details the changes from v5.3 to 6.0...
     
    As we've just had to fix a bug pointed out by a client (very embarasing)
    Which invloved the new handleevent on the client side
     
    eg the CuteEditor_OnCommand(editor,command,ui,value)!!! for which there is nothing in the developer guide!
    (and no example on the site, but there is an example in the howto?)
     
    Where we previously had to do something like
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Editor1.Attributes["oncommand"] = "HandleEditorCommand(this)";
     // add javascript
     ClientScriptManager cs = Page.ClientScript;
     if (!cs.IsStartupScriptRegistered("DeleteConfirm"))
     {
      String strScript = @"
       function HandleEditorCommand(editor)
        {
         if(event.command=='PostBack')
         {
          if (event.commandvalue=='DeleteItem'){
           event.returnValue = confirm(""Are you sure you wish to delete this item any child items will also be deleted? \n\n Deleted items can not be retrieved."");
          }else if (event.commandvalue=='DeleteItemPromote'){
           event.returnValue = confirm(""Are you sure you wish to delete this item any child items will be promoted? \n\n Deleted items can not be retrieved."");
          }
         }
        }";
     }
     
    Can you confirm that the correct approach is now
     
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    ClientScriptManager cs = Page.ClientScript;
    if (!cs.IsStartupScriptRegistered("DeleteConfirm"))
    {
     String strScript = @"
      function CuteEditor_OnCommand(editor,command,ui,value)
      {
        //handle the command by yourself
        if(command.toLowerCase()==""postback"")
        {
          if (value=='DeleteItem'){
        return !confirm(""Are you sure you wish to delete this item any child items will also be deleted? \n\n Deleted items can not be retrieved."");
         }else if (value=='DeleteItemPromote'){
        return !confirm(""Are you sure you wish to delete this item any child items will be promoted? \n\n Deleted items can not be retrieved."");
         }
         //alert(""The Save Command is Captured at the client side. You can hook up your business logic here.\n You can also stop this command."");
         //return true;//return true if you want to stop the command
        }
      }";
    }
    With the slightly annoying change of a return true now halts the event, rather than previously (and perhaps more logical in my eyes) as return false.
     
    cheers
    Mike
  •  01-26-2008, 12:31 AM 36569 in reply to 36553

    Re: What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

    Mike,
     
     
    >>CuteEditor_OnCommand(editor,command,ui,value)
     
    Example:
     
    function CuteEditor_OnCommand(editor,command,ui,value)
     {
      //handle the command by yourself
      if(command.toLowerCase()=="postback"&&value=="Save")
      {
       alert("The Save Command is Captured at the client side. You can hook up your business logic here.\n You can also stop this command.");
       return true;//return true if you want to stop the command
      }
     }
     
    Demo:
     
    How to capture the save button click event?

    How to capture the SAVE button click event?( C# | VB )

    This example demonstrates how to capture the SAVE button click event by using client-side code and server-side code.

     
    You can find the source code of this example in the download package.
     

    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

  •  03-06-2008, 9:59 AM 37627 in reply to 36569

    Re: What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

    I have tried this method but when I click on Save button (include in CuteEditor component) the aspx page is Postback.
     
    Is there any attribute on it (CuteEditor) to delete Postback ?
     
    Thanks,
     
    Ghislain MESSE
     
  •  03-06-2008, 10:12 AM 37633 in reply to 37627

    Re: What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

    Can you tell me what's the point you want to click this button and not postback?
     
    If above funtion, you can simply return true if you want to cancel the postback.
     
     if(command.toLowerCase()=="postback"&&value=="Save")
      {
       alert("The Save Command is Captured at the client side. You can hook up your business logic here.\n You can also stop this command.");
       return true;//return true if you want to stop the command
      }

    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

View as RSS news feed in XML