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

JScript Error in Editor (external Dialog FlashManager)

7 Answers 192 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 25 Nov 2010, 10:12 AM
Hi, i downloaded the trial and copied the FlashManager.asCx provided in ../EditorDialogs/ and then i tried to customize it. Having solved all "localization" errors, i still get the following error (using the provided sourcecode):

Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: type

I'm using Telerik.Web.UI , Version 5.2.0.0__1f131a624888eeed.

I need to change the behaviour of the flashmanager dialog, because i want to have other html code generated (embedding flash object using swfobject...)

EDIT:

continued debugging and found the line which causes the error (l. 2705):
2690var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) {
2691 /// <summary locid="M:J#Sys.Component.create" />
2692 /// <param name="type" type="Type"></param>
2693 /// <param name="properties" optional="true" mayBeNull="true"></param>
2694 /// <param name="events" optional="true" mayBeNull="true"></param>
2695 /// <param name="references" optional="true" mayBeNull="true"></param>
2696 /// <param name="element" domElement="true" optional="true" mayBeNull="true"></param>
2697 /// <returns type="Sys.UI.Component"></returns>
2698 var e = Function._validateParams(arguments, [
2699 {name: "type", type: Type},
2700 {name: "properties", mayBeNull: true, optional: true},
2701 {name: "events", mayBeNull: true, optional: true},
2702 {name: "references", mayBeNull: true, optional: true},
2703 {name: "element", mayBeNull: true, domElement: true, optional: true}
2704 ]);
2705 if (e) throw e;

EDIT II:
I should mention that I only copied "FlashManger.asCx" to my external Dialogs folder. Is it needed to have other controls in the same directory?

EDIT III:
Screenshot (attachment)

EDIT IV:
Just exchanged the whole source code from FlashManager.ascx with InsertLink.ascx and I still get the same problems
Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: type

Thanks in advance,

Stephan

7 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 26 Nov 2010, 10:51 AM
Hi Stephan,

I am not quite sure what may cause the error that you are experiencing. To be able to provide any further assistance we will need to examine the customizations that you have implemented. Could you please open a support ticket and provide a sample project reproducing the problem so we can investigate it further?

If you want to modify the HTML generated by the FlashManager dialog, the recommended approach is to handle the RadEditor's ClientPasteHtml client-side event and modify the content to match the requirements, e.g.:
<telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="OnClientPasteHtml">
    <FlashManager ViewPaths="~/UserDir" />
</telerik:RadEditor>
 
<script type="text/javascript">
    function OnClientPasteHtml(editor, args)
    {
        var commandName = args.get_commandName();
 
        if (commandName == "FlashManager")
        {
            var value = args.get_value();
 
            //modify value variable to match the requirements
 
            args.set_value(value);
        }
    }
</script>


Regards,
Dobromir
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Stephan
Top achievements
Rank 1
answered on 30 Nov 2010, 10:17 AM
Hi Dobromir,

First I have to say thanks for your support.

I just put a FlashManager.ascx in my external Dialogs Folder and used the source code you just provided. When I now open the Editor and try to Insert a FlashFile, I get the Screen attached (a blank Panel with "FlashManager" as title).

There are 2 things I need to change in my FlashManager:
 - the author should (without having html knowledge) be able to specify a place holder image for people which do not have Flash on their device
 - the FlashFile should be inserted using swfobject instead of object. swfobject is able to detect the flash version or if there is any flash player installed at all. swfobject can display an img if no flashplayer is installed.

Thanks in advance,

Stephan
0
Stephan
Top achievements
Rank 1
answered on 30 Nov 2010, 10:30 AM
Well, Hi again,

sorry I think I just misunderstood something :) (didn't use the full source code you provided).

So if I click the FlashManager-Button, it just opens a new Window with a full new RadEditor in it. That's not what I meant.

The whole thing is already working, but not with swfobject. I attached 2 Screenshots and the Code which is generated:

<object height="150" width="150" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param name="Movie" value="/Global/Documents/tfp_1.swf">
<param name="play" value="true">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<param name="loop" value="false">
<param name="menu" value="false"><embed src="/Global/Documents/tfp_1.swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" wmode="transparent" loop="false" menu="false" width="150" height="150"></object>
0
Stephan
Top achievements
Rank 1
answered on 30 Nov 2010, 10:45 AM
screenshot1
0
Stephan
Top achievements
Rank 1
answered on 30 Nov 2010, 10:45 AM
screenshot2
0
Stephan
Top achievements
Rank 1
answered on 30 Nov 2010, 10:46 AM
i cannot proper attach files somehow :/
0
Dobromir
Telerik team
answered on 01 Dec 2010, 04:50 PM
Hi Stephan,

Correct me if I am wrong but I believe you are using RadEditor for MOSS. If this is the case, the version 5.2.0.0 is quite old. I would recommend you to upgrade to the latest version of RadEditor for MOSS (currently 5.8.4.0). You can find detailed information on how to upgrade to a newer version of RadEditor in the following help article:
Upgrading to a newer version of RadEditor for MOSS

The approach that I have provided in my previous answer is for RadEditor for ASP.NET AJAX. To handle the ClientPasteHtml client-side event for RadEditor for MOSS you need to:
  1. Set the corresponding property in the ConfigFile.xml, e.g.
    <property name="OnClientPasteHtml">OnClientPasteHtml</property>
  2. Add the javascript function from my previous reply in the MOSSEditorTools.js. Please note that the function is not fully working solution and you need to extend it to match the exact requirements.

However, if you wish to apply the modifications in the dialog, you need to modify the getResult() function of the FlashPreviewer prototype to generate the required output.

Regards,
Dobromir
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Stephan
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Stephan
Top achievements
Rank 1
Share this question
or