Problem with CloseDlg()

3 posts, 1 answers
  1. Kamran Baygani
    Kamran Baygani avatar
    3 posts
    Member since:
    Sep 2004

    Posted 17 Jun 2008 Link to this post

    Hi,

    I my custom dialog page I have a button wich call a function that close my custom dialog and return a value to the editor using the CloseDlg() function.

    But I hava a little problem with this function, it seems like after the custom dialog is closed it is instantaneously reloaded and so,the custom dialog page cannot be closed.

    Here is my command function and callback function in MOSSEditorTool.js:
    var RadEditorClientObject = null;
    RadEditorCommandList["FlvManager"] = function FlvManagerCommand(commandName, editor, args)
    {
         RadEditorClientObject = editor;
         editor.ShowDialog(
        "/_wpresources/RadEditorSharePoint/4.3.2.0__1f131a624888eeed/RadControls/Editor/Dialogs/FlvManager.aspx",
        null,
        495,
        435,
        CustomDialogCallBack,
        null,
        "Flv Manager");
    };
    function CustomDialogCallBack(returnValue)
    {
        if(returnValue)
        {
           RadEditorClientObject.PasteHtml(returnValue.value);
        }
    }

    And in my custom dialog box, I have this javascript code:

     <script type="text/javascript">
        InitializeRadWindow();
        </script>
    if (window.attachEvent)
    {
        window.attachEvent("onload", initDialog);
    }
    else if (window.addEventListener)
    {
        window.addEventListener("load", initDialog, false);
    }

    var content = document.getElementById("infoHidden");

    function getRadWindow()
    {
       if (window.RadWindow)
       {
          return window.RadWindow;
       }
       if (window.frameElement && window.frameElement.RadWindow)
       {
          return window.frameElement.RadWindow;
       }
       return null;
    }

    var clientParameters;
    function initDialog()
    {
        clientParameters = getRadWindow().ClientParameters;   
        content.value = clientParameters;
    }
     function insertFlvLink()
    {
        var returnValue =
        {
            value:document.getElementById('hiddenInfo')
        };
        alert("return value = " + returnValue.value);
        CloseDlg(returnValue);
    }

    Can someone help me about this problem?
    Thank you in advance
  2. Answer
    George
    Admin
    George avatar
    859 posts

    Posted 19 Jun 2008 Link to this post

    Hi Kamran,

    Could you please clarify which version of the control you are using? Note that the approach you are using is for the 5.x version of RadEditor for MOSS (the ASP.NET AJAX version).

    If you are using a prior version please review the MyCustomDialog.html in the following help article - there you can review how to achieve the desired behavior:
    http://www.telerik.com/support/kb/article/b454K-baab-b454T-cgg-b454c-cgg.aspx

    I hope this helps.

    Kind regards,
    George
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  3. Kamran Baygani
    Kamran Baygani avatar
    3 posts
    Member since:
    Sep 2004

    Posted 19 Jun 2008 Link to this post

    Hi George,

    Effectively, I was using a prior version than version 5.I have modified my code and used the version 4 approach and it works fine.

    Thank you for your help.

    Best regards,

    Kamran
Back to Top