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

this.set_isDom(false); - Microsoft JScript runtime error: Object doesn't support this property or method

3 Answers 221 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 24 Jun 2011, 06:17 PM
Hello Telerik!

Here's a challenge for you! I have implemented a RadEditor coupled with a RadTreeView(within a RadPanelBar) with Drag-and-Drop functionality packaged into a user control(example taken from this site).

When this user control is placed squarely onto an aspx page, it works perfectly fine. My problem is this, I have two instances of this user control within my web project: The one on the page(instance #1; works fine), and there is another instance placed within a custom user control(instance #2; broken); which is a custom-built(legacy) ModalPopup user control using an UpdatePanel. This ModalPopup is then placed within another user control(let's call it KeyView). And KeyView is placed on an aspx page within an UpdatePanel on the page.

I do realize that instance #2 is not ideal or optimal, but I have to figure out a way to make this work in the most time efficient manner possible; the various layers of UpdatePanels have created a multitude of issues with script tags and CSS within markup not being recognized. Most of these issues have been resolved when I migrated all of the script tags/CSS into external files and registered them from the code behind on the page.

The last remaining issue that I am seeing is that when I create a custom ContentFilter for my RadEditor, I am configuring what is seemingly basic functionality for the ContentFilter and it is not being recognized, I am attaching a screenshot of the error, and I will paste my code below:
function OnEditorLoad(editor, args) {
    if (editor) {
        editor.get_filtersManager().add(new myConvertFilter());
        editor.attachEventHandler("onkeydown", reKeyDown);
        editor.attachEventHandler("onkeyup", reKeyDown);
    }
}
 
myConvertFilter = function () {
myConvertFilter.initializeBase(this);
this.set_isDom(false);
this.set_enabled(true);
this.set_name("html filter");}
myConvertFilter.prototype =
{
getHtmlContent : function(content)
{
var IndexValue = document.getElementById('ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel').selectedIndex;
var SelectedVal = document.getElementById('ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel').options[IndexValue].value;
var newContent = content;
if (SelectedVal == "1") {
newContent = newContent.replace(/©/g,"\[c\]");
newContent = newContent.replace(/®/g,"\[r\]");
newContent = newContent.replace(/™/g,"\[t\]");
newContent = newContent.replace(/•/g,"\[b\]");
newContent = newContent.replace(/–/g,"\[n\]");
newContent = newContent.replace(/—/g,"\[m\]");
newContent = newContent.replace(/¶/g,"\[ps\]");
newContent = newContent.replace(/§/g,"\[ds\]");
newContent = newContent.replace(/†/g,"\[da\]");
newContent = newContent.replace(/‡/g,"\[dd\]");
newContent = newContent.replace(/<STRONG>/g,"<b>");
newContent = newContent.replace(/<\/STRONG>/g,"<\/b>");
newContent = newContent.replace(/<FONT/g,"<font");
newContent = newContent.replace(/<\/FONT>/g,"<\/font>");
newContent = newContent.replace(/<B>/g,"<b>");
newContent = newContent.replace(/<\/B>/g,"<\/b>");
newContent = newContent.replace(/<strong>/g,"<b>");
newContent = newContent.replace(/<\/strong>/g,"<\/b>");
newContent = newContent.replace(/<U>/g,"<u>");
newContent = newContent.replace(/<\/U>/g,"<\/u>");
newContent = newContent.replace(/<BR>/g,"<br>");
newContent = newContent.replace(/<\/BR>/g,"<\/br>");
newContent = newContent.replace(/<SUP>/g,"<sup>");
newContent = newContent.replace(/<\/SUP>/g,"<\/sup>");
newContent = newContent.replace(/<EM>/g,"<i>");
newContent = newContent.replace(/<\/EM>/g,"<\/i>");
newContent = newContent.replace(/<I>/g,"<i>");
newContent = newContent.replace(/<\/I>/g,"<\/i>");
newContent = newContent.replace(/<P/g,"<p");
newContent = newContent.replace(/<\/P>/g,"<\/p>");
newContent = newContent.replace(/<T/g,"<t");
newContent = newContent.replace(/<\/T>/g,"<\/t>");
newContent = newContent.replace(/align=/g,"alignment=");
} return newContent;},
 
getDesignContent : function(content)
{
var IndexValue = document.getElementById('ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel').selectedIndex;
var SelectedVal = document.getElementById('ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel').options[IndexValue].value;
var newContent = content;
if (SelectedVal == "1") {
newContent = newContent.replace(/\[c\]/g,"©");
newContent = newContent.replace(/\[r\]/g,"®");
newContent = newContent.replace(/\[t\]/g,"™");
newContent = newContent.replace(/\[b\]/g,"•");
newContent = newContent.replace(/\[n\]/g,"–");
newContent = newContent.replace(/\[m\]/g,"—");
newContent = newContent.replace(/\[ps\]/g,"¶");
newContent = newContent.replace(/\[ds\]/g,"§");
newContent = newContent.replace(/\[da\]/g,"†");
newContent = newContent.replace(/\[dd\]/g,"‡");
newContent = newContent.replace(/<b>/g,"<STRONG>");
newContent = newContent.replace(/<\/b>/g,"<\/STRONG>");
newContent = newContent.replace(/<font/g,"<FONT");
newContent = newContent.replace(/<\/font>/g,"<\/FONT>");
newContent = newContent.replace(/<b>/g,"<B>");
newContent = newContent.replace(/<\/b>/g,"<\/B>");
newContent = newContent.replace(/<b>/g,"<strong>");
newContent = newContent.replace(/<\/b>/g,"<\/strong>");
newContent = newContent.replace(/<u>/g,"<U>");
newContent = newContent.replace(/<\/u>/g,"<\/U>");
newContent = newContent.replace(/<br>/g,"<BR>");
newContent = newContent.replace(/<\/br>/g,"<\/BR>");
newContent = newContent.replace(/<sup>/g,"<SUP>");
newContent = newContent.replace(/<\/sup>/g,"<\/SUP>");
newContent = newContent.replace(/<i>/g,"<EM>");
newContent = newContent.replace(/<\/i>/g,"<\/EM>");
newContent = newContent.replace(/<i>/g,"<I>");
newContent = newContent.replace(/<\/i>/g,"<\/I>");
newContent = newContent.replace(/<p/g,"<P");
newContent = newContent.replace(/<\/p>/g,"<\/P>");
newContent = newContent.replace(/<t/g,"<T");
newContent = newContent.replace(/<\/t>/g,"<\/T>");
newContent = newContent.replace(/alignment=/g,"align=");
} return newContent; }
 
}
 
myConvertFilter.registerClass('myConvertFilter', Telerik.Web.UI.Editor.Filter);

As you can see from the screenshot, it breaks on: this.set_isDom(false);. If I were to comment out that line, it breaks on any of the following lines:
this.set_isDom(false);
this.set_enabled(true);
this.set_name("html filter");

I am also seeing, and this is notated in the bordered section of the screenshot, that set_isDom, set_enabled, and set_name are not available methods of "this".

Anyway, I hope someone can shed some light on this issue, I welcome any and all suggestions and comments, I do realize that this is not an ideal way to be doing this. I just need some help on how to get this to a working state until I can have enough time to fix this in a proper manner.

Thanks in advance!

3 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 27 Jun 2011, 11:21 AM
Hi Andrew,

The methods set_isDom(), set_enabled(), set_name() are methods of the base RadEditor.Filter client-side object. You can experience this problem if the custom content filter is registered on page before the RadEditor's core JavaScript is loaded.

Could you please try to register the external JS file containing the custom content filter after the RadEditor's declaration (i.e. you can place the <script> tag just before the closing the form) and see if the problem still occurs?

All the best,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start 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
Andrew
Top achievements
Rank 1
answered on 27 Jun 2011, 03:55 PM
UPDATE: It appears to have no positive effect. It is still looking at those three lines as unsupported. Did this work for you?

Also, you mentioned that these methods are supported by the "base" Editor.Filter object, would this line then, be incorrect?

myConvertFilter.registerClass('myConvertFilter', Telerik.Web.UI.Editor.Filter);

Would I be able to just register the base class instead?
0
Dobromir
Telerik team
answered on 30 Jun 2011, 01:22 PM
Hi Andrew,

I am not quite sure why this is not working on your side. I have attached a sample page demonstrating the approach. Could you please modify it to a point where the problem occurs and send it back so we can investigate it further?

In addition, I have prepared a video demonstrating my test. Could you see if I am doing something wrong?
http://screencast.com/t/jbb5JbEF

Greetings,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start 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
Andrew
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or