Problem with double click on Custom Button

Last post 11-22-2007, 8:25 PM by huythan. 4 replies.
Sort Posts: Previous Next
  •  11-22-2007, 1:16 AM 35296

    Problem with double click on Custom Button

    Hi
    When I click on it, it do well. But when I double click on it, an error message is displayed.
    " Command Test is Not Supported or Not Implemented"
    Plz see my javascript
     
    function Testing(){
       for(i = 0 ; i <= 10000; i++)
       { 
       
           var editor1 = document.getElementById('abc');
       }
    }
     
    And the code behind
     
    ctrlTest = ViewEditor.CreateCommandButton("Testing", "test.gif", "Testing")
    ctrlTest.Attributes("onclick") = "Testing();"
    ViewEditor.InsertToolControl(1, "Testing", ctrlTest )
     
     
  •  11-22-2007, 1:24 AM 35297 in reply to 35296

    Re: Problem with double click on Custom Button

    Please check this example:
     
     
    Double click the insert date custom button.
     
    It works fine for me.
     
    Your code looks fine to me too. The problem is in some where else.
     
    Please just modify the example above to meet your requirement. The source code of this example can be found 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

  •  11-22-2007, 4:02 AM 35299 in reply to 35297

    Re: Problem with double click on Custom Button

    It is still happen in the sample. 
     
    The problem doesn't occur with the code 
       Dim Image1 As New System.Web.UI.WebControls.Image()
       Image1.ToolTip    = "Insert today's date"
       Image1.ImageUrl    = "tools.gif"
       Image1.CssClass    = "CuteEditorButton"
       SetMouseEvents(Image1)
       Image1.Attributes("onclick")="Testing();"
       tc.Control.Controls.Add(Image1)
     
    But it will be a problem with this
       Dim ctrlTwoColumns As System.Web.UI.WebControls.WebControl
       ctrlTwoColumns = Editor1.CreateCommandButton("Testing", "download.gif", "Testing")
       ctrlTwoColumns.Attributes("onclick") = "Testing();"
       tc.Control.Controls.Add(ctrlTwoColumns)
     
    Maybe something wrong with System.Web.UI.WebControls.WebControl when receiving doubleclik event
     
  •  11-22-2007, 11:17 AM 35307 in reply to 35296

    Re: Problem with double click on Custom Button

    CuteEditor handle the ondblclick , and try to ExecCommand("Testing")

    So please Use blank  command name :
    ctrlTest = ViewEditor.CreateCommandButton("", "test.gif", "Testing")
    ctrlTest.Attributes("onclick") = "Testing();"
    ViewEditor.InsertToolControl(1, "Testing", ctrlTest )
     
    Regards , Terry .
  •  11-22-2007, 8:25 PM 35322 in reply to 35307

    Re: Problem with double click on Custom Button

    Yeap, It works. Thanks alot
View as RSS news feed in XML