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
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