This is a migrated thread and some comments may be shown as answers.

Problem with CloseDlg()

2 Answers 70 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Kamran Baygani
Top achievements
Rank 1
Kamran Baygani asked on 17 Jun 2008, 11:58 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 19 Jun 2008, 08:37 AM
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
0
Kamran Baygani
Top achievements
Rank 1
answered on 19 Jun 2008, 10:12 AM
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
Tags
WebParts for SharePoint
Asked by
Kamran Baygani
Top achievements
Rank 1
Answers by
George
Telerik team
Kamran Baygani
Top achievements
Rank 1
Share this question
or