What to I need to set to get them to work,
right now all 3 results in the "value cannot be null".
Right now, the only settings for my editor is...
reDescription.DialogParameters.Clear();
ParameterCollection imageArgumentsDesc = new ParameterCollection();
imageArgumentsDesc.Add(new Parameter("ThumbSuffix", reDescription.ThumbSuffix));
imageArgumentsDesc.Add(new Parameter("MaxImageSize", reDescription.MaxImageSize.ToString()));
imageArgumentsDesc.Add(new Parameter("AllowThumbGeneration", reDescription.AllowThumbGeneration.ToString()));
imageArgumentsDesc.Add(new Parameter("SiteUrl", SPEncode.UrlEncode(sURL)));
imageArgumentsDesc.Add(new Parameter("WebUrl", SPEncode.UrlEncode(sRelativeURL)));/**/
reDescription.DialogParameters.Add("SharePoint/ImageManager", imageArgumentsDesc);
Or even better, where can i see what i can setup through a ParameterCollection?
5 Answers, 1 is accepted
Hello Nikolaj,
Can you remove reDescription.DialogParameters.Clear(); and see if problem persists? The editor uses the DialogPrameters collection for passing some special parameter to the dialogs.
Have a nice day,
George
the telerik team
Tried to before adding myself...
Response.Write(reDescription.DialogParameters.Count.ToString());
... the output was "0"
Hello Nikolaj,
Does that code work for the ImageManager dialog? If yes, you need to do the same for the Flash, Media, Document and Template manager dialogs. Here is the code which should work (taken from the implementation of r.a.d.editor SharePoint edition):
private ParameterCollection SharePointArguments()
{
ParameterCollection dialogArguments = new ParameterCollection();
dialogArguments.Add(new Parameter("SiteUrl", SPEncode.UrlEncode(Request.Params.Get("SiteUrl"))));
dialogArguments.Add(new Parameter("WebUrl", SPEncode.UrlEncode(Request.Params.Get("WebUrl"))));
dialogArguments.Add(new Parameter("WebID", SPEncode.UrlEncode(Request.Params.Get("WebID"))));
return dialogArguments;
}
private void SetSharePointDialogs()
{
contentEditor.DialogParameters.Clear();
ParameterCollection imageArguments = SharePointArguments();
imageArguments.Add(new Parameter("ThumbSuffix", contentEditor.ThumbSuffix));
imageArguments.Add(new Parameter("MaxImageSize", contentEditor.MaxImageSize.ToString()));
imageArguments.Add(new Parameter("AllowThumbGeneration", contentEditor.AllowThumbGeneration.ToString()));
contentEditor.DialogParameters.Add("SharePoint/ImageManager", imageArguments);
ParameterCollection documentArguments = SharePointArguments();
documentArguments.Add(new Parameter("MaxDocumentSize", contentEditor.MaxDocumentSize.ToString()));
contentEditor.DialogParameters.Add("SharePoint/DocumentManager", documentArguments);
ParameterCollection flashArguments = SharePointArguments();
flashArguments.Add(new Parameter("MaxFlashSize", contentEditor.MaxFlashSize.ToString()));
contentEditor.DialogParameters.Add("SharePoint/FlashManager", flashArguments);
ParameterCollection mediaArguments = SharePointArguments();
mediaArguments.Add(new Parameter("MaxMediaSize", contentEditor.MaxMediaSize.ToString()));
contentEditor.DialogParameters.Add("SharePoint/MediaManager", mediaArguments);
ParameterCollection templateArguments = SharePointArguments();
templateArguments.Add(new Parameter("MaxTemplateSize", contentEditor.MaxTemplateSize.ToString()));
contentEditor.DialogParameters.Add("SharePoint/TemplateManager", templateArguments );
contentEditor.DialogParameters.Add("SharePoint/SetImageProperties", SharePointArguments());
}
You need to call the SetSharePointDialogs in your Page_Load event.
Let us know how it goes,
But I got a question about the WebID, whats that for? Doesn't really looks like its necessary.
WebID is used in the internal implementation of r.a.d.editor SharePoint Edition and indeed might not be necessary in your case. You can remove it from your code.
However there is one improvement you can make. If you want the dialogs to show only the document libraries visible in the current web you should replace
Request.Params.Get("SiteUrl") with SPControl.GetContextSite(Context).Url
and
Request.Params.Get("WebUrl") with SPControl.GetContextWeb(Context).ServerRelativeUrl.
Regards,
Albert
the telerik team