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

Dynamic Tools & Modules Bug

9 Answers 164 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Shaun Peet
Top achievements
Rank 2
Shaun Peet asked on 02 Jan 2008, 05:34 PM
This seems like a bug...

Assume that there is a valid toolsfile that does not have any modules in it.

1) Just using the toolsfile - the modules area does not appear
2) Just adding tools dynamically - modules area appears
3) Just adding tools dynamically and using RadEditor1.Modules.Clear - modules area appears
4) Using the tools file, clearing the tools and then re-adding them dynamically - the modules area does not apear.

I'll use #4 as a temporary hack but I do believe this is a bug.

I discovered this because I want my editor to add a tool dynamically in some cases, but not all cases.  For some unknown reason, sometimes when I went to add that last tool on an editor that was using a toolsfile, the added tool was the only one being displayed.  To add to the confusion - it was not always doing that although I think it may have to do with the editor being inside a FormView vs. being directly on the page.

In any case, that problem made me go to the entirely dynamic tools model (which I like better) but the modules area was showing up.

9 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 07 Jan 2008, 03:51 PM
Hello Shaun,

Here is some information that should be useful:

As all Prometheus controls are contained in a single DLL, RadEditor's default tools file is also contained as a built-in resource there. The tools file contains both default tools and default modules.

When the developer adds tools in the codehbehind using the editor API, the default tools file is loaded, yet it is not cleared. This is based on the assumption that the developer has full control over the API and can easily clear the default tools before adding new ones.

When an external ToolsFile is used - then editor modules will be loaded in the editor, only if they are present in the toolsfile.

Now, there seems to be an incorrect statement in your scenario #3 - this is not the intented behavior, and we were not able to reproduce it either.

Case by case, here is update on each scenario:

1) Just using the toolsfile - the modules area does not appear - CORRECT
2) Just adding tools dynamically - modules area appears - CORRECT, the default tools file is used, and modules exist there.
3) Just adding tools dynamically and using RadEditor1.Modules.Clear - modules area appears - Not able to reproduce. In our tests using RadEditor1.Modules.Clear does clear the modules, in all cases.

4) Using the tools file, clearing the tools and then re-adding them dynamically - the modules area does not apear. - CORRECT. You use a tools file with no modules, so no modules will appear, regardless of whether you clear the tools or not.


In case you observe different behavior than the provided in these explanations, please send us a sample project that reproduce the issues and we will examine it. 

Best regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shaun Peet
Top achievements
Rank 2
answered on 07 Jan 2008, 09:14 PM
Scenario 3:

-RadEditor inside of a FormView, with it's Content property bound
-Inside the Page_Load, the editor is passed to a helper function that defines all the settings, using FormView1.FindControl(RadEditor1)
-The helper function does this (in order):
-- sets the height & width
-- sets the editmodes
-- sets the stripformattingoptions
-- clears all the modules
-- clears all the tools
-- loads the tools needed
-- loads other items if needed (snippets, custom links, etc)
-- sets the paths for the image/document/flash/media/template managers

This is the result (the module area is highlighted in yellow - there's no modules loaded but there's alot of space taken up):

www.microagebasics.com/public/images/websiteimages/modulearealoaded.jpg

0
Lini
Telerik team
answered on 09 Jan 2008, 01:19 PM
Hello Shaun,

I tested the scenario using the 2007.03.1218 version of RadEditor Prometheus. Here is the code I use to set the editor config from Page_Load():

        RadEditor1.Height = Unit.Pixel(600);  
        RadEditor1.Height = Unit.Pixel(300);  
        RadEditor1.EditModes = Telerik.Web.UI.EditModes.Design;  
        RadEditor1.StripFormattingOptions = Telerik.Web.UI.EditorStripFormattingOptions.MSWordRemoveAll;  
        RadEditor1.Modules.Clear();  
        RadEditor1.Tools.Clear();  
        RadEditor1.Tools.Add(new Telerik.Web.UI.EditorToolGroup());  
        RadEditor1.Tools[0].Tools.Add(new Telerik.Web.UI.EditorTool("ImageManager"));  
        ... 

I am clearing the tools and modules collections and I am adding tools dynamically. The editor rendered OK ( no modules were loaded and the modules area was not visible). I am attaching a screenshot of the resulting editor.

If possible, send us the code that you use to configure the editor so we can investigate further.

Greetings,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shaun Peet
Top achievements
Rank 2
answered on 09 Jan 2008, 07:58 PM
I'm also using the same version of the dll.  The only difference that there could be (only because you didn't mention it) is that the editor is inside a FormView EditItemTemplate (and InsertItemTemplate) in my case, with the Content bound to a datafield.
0
Lini
Telerik team
answered on 10 Jan 2008, 05:10 PM
Hello Shaun,

I don't think that the problem is caused by the form view. However, it might be related to the fact that you have more than one editor on the page and I tried with only one. I will do some more tests with 2 editors to see if this is the case.

If possible, try to isolate the problem on a simple page (inside a formview or not) and send us the code so we can find the problem faster.

All the best,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shaun Peet
Top achievements
Rank 2
answered on 23 Jan 2008, 02:59 AM
This problem has not been fixed in Q3 by the way...
0
Lini
Telerik team
answered on 24 Jan 2008, 09:17 AM
Hello Shaun,

I am still unable to reproduce the problem (using 2 or even 3 editors on the page). Please open a formal support ticket and send us the code for your form view (aspx and codebehind) so we can examine it.

All the best,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shaun Peet
Top achievements
Rank 2
answered on 14 Apr 2008, 03:25 PM
I've been able to confirm that it is indeed the FormView that causes this bug to occur.  I've finally found time to create a sample project for you and have submitted it as a bug report: 131954
0
Accepted
Rumen
Telerik team
answered on 17 Apr 2008, 07:11 AM
Hi Shaun,

Thank you for the provided project.

We were able to reproduce the issue and we logged it with high priority in our bug tracking system. We will do our best to fix the problem in the SP1 release of RadControls for ASP.NET AJAX.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Shaun Peet
Top achievements
Rank 2
Answers by
Tervel
Telerik team
Shaun Peet
Top achievements
Rank 2
Lini
Telerik team
Rumen
Telerik team
Share this question
or