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

Sharepoint Editor Dialogs - client API

5 Answers 116 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jay Guiang
Top achievements
Rank 1
Jay Guiang asked on 14 Nov 2008, 04:58 PM
I am trying to use the client api for the radeditor in a sharepoint (wss) site.  Specifically, I am trying to open the dialogs from a seperate button.  I have figured it out for the ImageManager using the function:
    $find("<%=radEditor.ClientID%>").showDialog("ImageManger", null, ClientCallBackFunction);

I have also discovered that the return value from the dialog can be found in the resultObj parameter in the ClientCallBackFunction(sender, resultObj) function.  (Specifically in the resultObj['Result']['outerHTML']).

I am trying to figure the same for the other dialogs, specifically the Document Manager, Flash Manager, and Media Manager.  Can you please provide me how to:
    1. Call the the specific Dialogs.  (i.e. When I try showDialog("DocumentManger", null, ClientCallBackFunction); I get a javascript error).
    2. The parameters for the showDialog function. (i.e. I have seen documentation on the showDialog, but it is specific to custom dialogs.  I need to know the parameters for the Sharepoint specific dialogs).
    3. How to retrieve the result of the the dialogs.  (i.e. When I tried it with the FlashManager, I cannot seem to find the correct property in the resultObj that outputs the <object> tag for the selected flash (.swf) file.

Thanks

5 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 18 Nov 2008, 10:04 AM
Hi Jay,

In our online knowledge base you can find an article called Using the Image and Document managers outside RadEditor: http://localhost:2252/Live%20Demos/Editor/Examples/UseStandAloneDialogues/OpenDialogue.aspx .
I believe that it is helpful in your case.

You also should make sure that you have enabled the dialogues that you want to use. In order to do so you need to edit the respective ToolsFile.xml file which is located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.0.0__1f131a624888eeed\Resources folder.

Just add these nodes:
<tool name="FlashManager" />
<tool name="DocumentManager" />
<tool name="MediaManager" />


Kind regards,
Stanimir Patarinski
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jay Guiang
Top achievements
Rank 1
answered on 18 Nov 2008, 02:56 PM

The link does not work.  I found another knowledge base item here: http://www.telerik.com/support/kb/aspnet-ajax/editor/using-the-image-and-document-managers-outside-radeditor.aspx.  Is this the same one?

If so, I have already tried using this approach.  I have 2 issues with this sample:

  1. I need a sample specific to WSS.  When I try to employ this solution I am getting issues when I try and open the Open ImageManager button.  I get the following javascript error: Web.config registration missing!  The Telerik dialogs require a HttpHandler registration in the web.config file. Please, use the control's Smart Tag to add the handler automatically, or see the help for more information: Controls > Editor > Dialogs.  Please provide the fix for this issue.
  2. This sample still does not answer #3 on my original post.  (i.e. When I tried it with the FlashManager, I cannot seem to find the correct property in the resultObj that outputs the <object> tag for the selected flash (.swf) file.)

 

Thanks Again.

 

0
Stanimir
Telerik team
answered on 21 Nov 2008, 04:00 PM
Hi Jay,

I apologize for the broken link that I sent you before. Yes, this is the same article.

Regarding the first issue, could you make sure, that you deployed RadControls for ASP.NET Ajax correctly.
1. First you need to install Telerik.Web.UI.dll  in the GAC (Global Assembly Cache).
2. You should add a few <SafeControl> entries within the <SafeControls> section in your web.config:

<SafeControl Assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" /> 
<SafeControl Assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Editor" TypeName="*" Safe="True"/> 
<SafeControl Assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Widgets" TypeName="*" Safe="True" /> 
<SafeControl Assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TypeName="*" Safe="True" /> 
<SafeControl Assembly="RadEditorSharePoint, Version=5.3.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint" TypeName="*" Safe="True" /> 
<SafeControl Assembly="RadEditorSharePoint, Version=5.3.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint.FieldEditor" TypeName="*" Safe="True" /> 
<SafeControl Assembly="RadEditorSharePoint, Version=5.3.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint.ListFieldEditor" TypeName="*" Safe="True" /> 


Regarding the FlashManager issue if your callback function is defined like FlashManagerFunction(sender, args) , you can find the output string in args.Result property.

Hope this helps.

Regards,
Stanimir
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jay Guiang
Top achievements
Rank 1
answered on 21 Nov 2008, 04:22 PM
Hi,

I have all those SafeControls setup in the web.config (still doesn't work).  Does I have to add some kind of httpHandler in the web.config?

Thanks
0
Lini
Telerik team
answered on 24 Nov 2008, 04:40 PM
Hello,

There is a known issue with the editor dialogs and SharePoint 2007. The dialogs are shown via a "dialog handler" page. By default, the editor looks for this page in the same folder as the page it is on. So, for example if the editor is on http://moss/Pages/Default.aspx, it will look for the dialog handler at http://moss/Pages/Telerik.Web.UI.DialogHandler.aspx. Usually, this is not a problem, since you only need a <httpHandler> definition in the web.config file for "Telerik.Web.UI.DialogHandler.aspx". Unfortunately, SharePoint has a special handler for ASPX files, which overrides the default ASP.NET handler and the "Telerik.Web.UI.DialogHandler.aspx" handler in the web.config. In order for the dialogs to show in SharePoint 2007, you need to instruct the editor to use a different url for the dialog handler, which is not controlled by the SharePoint. One such example is the layouts folder (http://moss/_layouts/). Try setting the editor's DialogHandlerUrl to "/_layouts/Telerik.Web.UI.DialogHandler.aspx" and see if that works. Note that you still need to have the httpHandler definition in the web.config file.

Kind regards,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Jay Guiang
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Jay Guiang
Top achievements
Rank 1
Lini
Telerik team
Share this question
or