Trying to use your file dialog box with a new custom control

Last post 04-14-2007, 12:09 AM by Adam. 7 replies.
Sort Posts: Previous Next
  •  01-22-2005, 4:15 PM 3643

    Trying to use your file dialog box with a new custom control

    Have the control working fine -- but the modal dialog box must be called with a ?settinghash=7ba8f77a" parameter.
    I "stole" the hash code from a display of the insertgallery popup (status line display at bottom of window).  Now have discovered that the hash code is carrying in the image gallery directory address and so is shareing my personal files with others (who's hash codes are different!)  Guess you can tell I'm not too swift with the ,net stuff!  Is there some way to code the javascript call with a reference to the current instance hash code for the editor's setting of the image directory?

    Here is what I am using at present:

    newwin_1=showModalDialog("CuteSoft_Client/CuteEditor/Dialogs/InsertGallery.aspx?settinghash=7ba8f77a", editor, "dialogWidth:670px;dialogHeight:650px");
     
  •  01-22-2005, 10:30 PM 3646 in reply to 3643

    Re: Trying to use your file dialog box with a new custom control

    Phil:
     
    Please try this way :
     
    var img=document.createElement("IMG");
    var url=showModalDialog("CuteSoft_Client/CuteEditor/Dialogs/InsertGallery.aspx?settinghash=<%=Editor1.Setting.GetHashString()%>", img,"dialogWidth:670px;dialogHeight:650px");
    if(url)
    {
       //..
    }
     
    Regards , Terry .
  •  03-19-2007, 1:59 PM 27502 in reply to 3646

    Re: Trying to use your file dialog box with a new custom control

    Worked fine in release 4.0 but now issues a return error of "null or not an object" in the curent release!
  •  03-19-2007, 2:27 PM 27504 in reply to 27502

    Re: Trying to use your file dialog box with a new custom control

    Phil,
     
    Have you checked this example?
     
    Add a Cross Browser Modal Dialog Box to Cute Editor

    How to create a custom button(client side) which displays a dialog?( C# | VB )

    This example demonstrates how easy it can be to add your own client side buttons to the CuteEditor by creating a Cross Browser Modal Dialog Box.


    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-19-2007, 5:12 PM 27509 in reply to 27504

    Re: Trying to use your file dialog box with a new custom control

    I am sure this tip would be of some help if I were only a bit smarter.  The above link does not show me the code that accomplishes this function!
     
    Further, I have been using Cute Editor for over 3 years and each release seems to break something that we had working before!
     
    In this instance 5.3 will display the custom button -- and two others exactly as the previous release did.  Further we capture the action successfully for all three custom buttons.  Two of these buttons work fine in 5.3 but the one that uses the following java script code fails to successfully invoke your Insert Image dialog box under 5.3.  It presents the dialog and the dialog appears to be fully functional -- however when we select an image (from the dialog) the following error occurs:
     
     
    The code that causes this behavior (which ran fine in 4.0) is as follows:
     
       var newwin_1=showModalDialog("CuteSoft_Client/CuteEditor/Dialogs/InsertGallery.aspx?settinghash=<%=Editor1.Setting.GetHashString()%>", editor, "dialogWidth:670px;dialogHeight:650px");
         var editor1=document.getElementById('<%=Editor1.ClientID%>'); 
          var editdoc = editor1.GetDocument();
       var test1 = new String(newwin_1);
    It is the assignment of the dialogs return value to the var newwin_1 which causes the error,
     
    This would seem that the returned value from the dialog has changed in this release.
     
    Any help you can offer will be greatly appreciated!
     
    Phil
     
  •  03-19-2007, 10:14 PM 27517 in reply to 27509

    Re: Trying to use your file dialog box with a new custom control

    Phil,
     
    Please try the following code:
     
    var img=document.createElement("IMG");
    var editor=document.getElementById('<%=Editor1.ClientID%>'); 
    var editdoc = editor1.GetDocument();
     
    var newwin_1=showModalDialog("CuteSoft_Client/CuteEditor/Dialogs/InsertGallery.aspx?settinghash=<%=Editor1.Setting.GetHashString()%>", {img:img,editor:editor,editdoc:vars.editdoc}, "dialogWidth:670px;dialogHeight:650px");
     
    Hope it helps.
     

     

    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-20-2007, 11:20 AM 27533 in reply to 27517

    Re: Trying to use your file dialog box with a new custom control

    Both of the last two lines "break" the custom button with a command not implemented.
     
    By changing  -- var editdoc = editor1.GetDocument();
    to -- var editdoc = editor.GetDocument();
    I get by the first problem. 
     
    I'm not a java developer so really don't understand the "new" call.  It appears that you have changed the attrubutes of the showModal call yet the old call displays the dialog window, but the "new" call breaks the java function.
     
    Phil
  •  04-14-2007, 12:09 AM 28322 in reply to 27533

    Re: Trying to use your file dialog box with a new custom control

    Phil,

    Version 6.0 is out.  This issue is resolved in this new release.

    A new example has been introduced. 

    How to use CuteEditor as a document selector?( Demo)

    How to use CuteEditor as a document selector?

     
    The upgrade is free.
     
    Demo:

    http://cutesoft.net/example/general.aspx

    Download:

    http://cutesoft.net/downloads/default.aspx


    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