Error if i show the page inside a frame

Feb 12, 2008 at 9:13 AM

I have frameset , and i am trying to load the page the RTE control is embedded
on load it is showing the following error (object required -> InitRte)

var tabstrip = new Microsoft.js.ui.TabStrip('tabstrip');var tabstripctl00 = new Microsoft.js.ui.Tab(tabstrip,'tabstripctl00','TextView','True');tabstrip.AddTab(tabstripctl00);this.tabstripctl00Click = new Microsoft.js.event.EventHandler(tabstripctl00.uiElement,'click','OnTextView',this,false);Microsoft.js.event.EventManager.add(this.tabstripctl00Click);var tabstripctl01 = new Microsoft.js.ui.Tab(tabstrip,'tabstripctl01','HtmlView','False');tabstrip.AddTab(tabstripctl01);this.tabstripctl01Click = new Microsoft.js.event.EventHandler(tabstripctl01.uiElement,'click','OnHtmlView',this,false);Microsoft.js.event.EventManager.add(this.tabstripctl01Click);InitRte();// -->

any solution for this?
Nov 24, 2009 at 1:56 PM

In the RTEStartup.js file, add a function: 

function GetEditorObject(editorId)
if (top.document.getElementById(editorId))
	return top.document.getElementById(editorId);
	return document.getElementById(editorId);

Then replace all references to "top.document.getElementById(editorId)" and replace them with "GetEditorObject(editorId)" (except the reference within the new function you added, of course) This fixed the problem for me.

Jan 9, 2010 at 5:29 AM

Can u send me your page.I dont know how to make it work :(

Jan 9, 2010 at 8:28 PM

It wasn't the page I changed - it was the RTE project javascript files I made the change in, then recompiled the project.

Essentially, the RTE uses "top.document.getElementById(editorId)" to get the editor object. "top" references your web page in the normal scenario, but if you're page is within a frame "top" references the top most web page - if this web page doesn't have an element with the same ID (which it won't :)) the call fails.

Because I'm naturally cautious changing anything - I decided to create a function that checks if "top" properly references a web page with this element ID in it, if so, the function returns that element, if not it returns the element in the current page.

I then changed everywhere that calls top.document.getElementById to this call this new function and bingo - RTE now works in frames!

Jan 10, 2010 at 8:27 AM
Edited Jan 11, 2010 at 5:20 AM

finally i figure it out.Thank you fritterfatboy

Jan 12, 2010 at 7:08 AM

I changed all top.document.getElementById(editorId) -> GetEditorObject(editorId) include dosub() function in Default.aspx page and except your new function but ist not working.

What can i do now ?

Jan 12, 2010 at 7:20 AM

What's the error you're getting, jabber?

Jan 12, 2010 at 7:35 AM
Edited Jan 12, 2010 at 7:56 AM

No error at all.I just cant type in main text editor.Like somethin blocking it.Im using firefox and vsw 2005 express.

This is my file.Pls check it fot me.

Jan 12, 2010 at 12:34 PM

Afraid a single file is of no use when finding errors with this - are you actually compiling the source code for this project before using it in your website? I didn't think VS express editions allowed you to compile project dlls.

Jan 12, 2010 at 3:59 PM

Now Im know what im missing.

After changing JS file how to make RTE source to RTE no source dll file ^^!

Jan 13, 2010 at 6:21 AM

Can u send me your RTE no source files, pls. I dont have enough ability to make it. :(