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

Dialog Parameters do not exist error on Custom Dialog example

4 Answers 129 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 25 Sep 2008, 08:29 PM
I'm trying to use the example for the Rad Custom Dialog, and I'm getting this error
when I click on my custom tool button.



Sys.ArgumentNullException: Dialog Parameters for the <xxx> dialog do not exist
Parameter name: dialogName

Any thoughts?

I'm using the example but I was trying to call my own user control.
I changed the "'s in the String.format to single 's because they were giving me syntax issues. I tried it both ways.

<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["InsertHyperText"] = function(commandName, editor, args)
{
var myCallbackFunction = function(sender, args){
editor.pasteHtml(String.format("<a href={0}>{1}</a> originalAttribute='href' originalPath='{0}>{1}</a>' originalAttribute='href' originalPath='{0}>{1}</a>' ", args.href, args.text))
}
editor.showDialog("InsertHyperText", {}, myCallbackFunction);
};

</script>

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 29 Sep 2008, 02:34 PM
Hi Fred,

Please, see the following help article on the subject: Adding Custom Dialogs.

If you want to avoid the usage of dialog definitions for the custom dialogs you should use the showExternalDialog  method to open the custom dialogs.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Darryl
Top achievements
Rank 1
answered on 11 Feb 2009, 04:08 PM
Why are the parameters for an RadEditor.showExternalDialog() callbackfunction different from a RadWindow onclientclose function?
Am I missing something?
Thanks

Darryl


e.g.
// RadWindow
function RadWindow_Close(returnvalue)
{
    var win = getRadWindow();
    win.argument = returnvalue;
    win.close();
}

function RadWindow_onclientclose(sender, args)
{
    // use sender.argument
}
// END RadWindow

// RadEditor showExternalDialog
function RadEditor_showExternalDialog_Close(returnvalue)
{
    getRadWindow().Close(returnvalue);
}

function RadEditor_showExternalDialog_callbackfunction(sender, args)
{
    // use args
}
// END RadEditor showExternalDialog

0
Rumen
Telerik team
answered on 16 Feb 2009, 01:40 PM
Hi Darryl,

Could you please, explain in more details your scenario and the problem that you experience? Are you trying to pass an argument from the Custom Dialog to the callback function of RadEditor?

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Darryl
Top achievements
Rank 1
answered on 16 Feb 2009, 02:51 PM
Hey Rumen

My dialogs are working fine. The code I provided above is the way I had to go. I am just surprised that there is a difference in the usage of the callback function parameters.

cheers
Darryl
Tags
Editor
Asked by
Fred
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Darryl
Top achievements
Rank 1
Share this question
or