Dynamic Tools & Modules Bug

10 posts, 1 answers
  1. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 02 Jan 2008 Link to this post

    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.
  2. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 07 Jan 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 07 Jan 2008 Link to this post

    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

  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 09 Jan 2008 Link to this post

    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
  6. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 09 Jan 2008 Link to this post

    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.
  7. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 10 Jan 2008 Link to this post

    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
  8. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 22 Jan 2008 Link to this post

    This problem has not been fixed in Q3 by the way...
  9. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 24 Jan 2008 Link to this post

    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
  10. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 14 Apr 2008 Link to this post

    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
  11. Answer
    Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 17 Apr 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017