Selection is lost if custom toolbar button has showtext=true

7 posts, 0 answers
  1. Truong Hong Thi
    Truong Hong Thi avatar
    10 posts
    Member since:
    Jun 2010

    Posted 10 Jun 2010 Link to this post

    I use RadEditor list for MOSS2007, and add a custom button with showtext=true. This button open a custom dialog. However, every time the button is clicked, editor's selection is lost (focus returns to beginning of text). This does not happen if showtext is false.

    Is there a way to show button text but keep selection intact when button is clicked?
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 10 Jun 2010 Link to this post

    Hello Truong,

    Could you confirm, which version of RadEditor for MOSS are you using? Is it the Lite version of RadEditor for MOSS 4.x or the Full ASP.NET AJAX (5.x) version of the control? In addition please provide me with the javascript code for the custom button.

    Thank you.

    Regards,
    Stanimir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  3. Truong Hong Thi
    Truong Hong Thi avatar
    10 posts
    Member since:
    Jun 2010

    Posted 10 Jun 2010 Link to this post

    I use the lite (free) version.

    ListToolsFile.xml
    <tools name="EnhancedToolbar" dockable="false" enabled="true">
    ....
        <tool name="Attach File"
            shortcut ="CTRL+K"
            showtext="true"
            iconurl="/_wpresources/RadEditorSharePoint/4.5.6.0__1f131a624888eeed/RadControls/Editor/Skins/Default2006/buttons/DocumentManager.gif" />
    ....

    MOSSEditorTools.js
    RadEditorCommandList["Attach File"] = function(commandName, editor, oTool)
    {
        Copy the whole stuff from MOSSImageManager function.
    }

    Steps:
    1. From any list view, click "New" to create a new list item (NewForm.aspx)
    2. Type some dummy text into the RadEditor
    3. Use mouse to select some text
    4. Click "Attach File" button. Please note that you should click on the text portion of the button, not the icon portion.
    5. Drag the popup dialog away to see the RadEditor behind, notice that the selection is lost -> this makes the link always be inserted at the beginning of the RTE.
    It does not happen if showtext is false (as it does not happen with MOSSLinkManager).
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 14 Jun 2010 Link to this post

    Hi Truong,

    Check if adding the following javascript code in the beginning of your method will solve the problem:

    if (window.RadControlsNamespace.Browser.IsIE && document.documentMode) editor.SetFocus();



    Kind regards,
    Stanimir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Truong Hong Thi
    Truong Hong Thi avatar
    10 posts
    Member since:
    Jun 2010

    Posted 14 Jun 2010 Link to this post

    No, I already tried it with no luck. This seems not an IE8 problem, nor a focusing one. It happens on IE6, IE7 as well.
    As far as I can see, the selection is lost at the moment you click the text portion of the button, before any JavaScript is fired. As a result, there seems to be no easy way to restore the selection. The link is always inserted at the beginning of the text.

    Seems that I should use an icon-only button.
  6. Nate
    Nate avatar
    28 posts
    Member since:
    Jul 2007

    Posted 21 Oct 2010 Link to this post

    for me, I am using the full version of MOSS editor on a wss3 instance.
    version:  5.8.0.0__1f131a624888eeed
    this for example does not work.
    <tool name="EmbedYouTubeVideo" iconurl="/_wpresources/RadEditorSharePoint/5.8.0.0__1f131a624888eeed/Resources/ToolImages/YTICON.gif" />
    However, if I remove the iconurl property it does work. Meaning that with the iconurl property the js function for that menu item will not run but if I remove the iconurl property it works fine.

    Any help would be great. Thanks.


  7. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 22 Oct 2010 Link to this post

    Hi Nate,

    Remove the following property from the custom tool: iconurl="/_wpresources/RadEditorSharePoint/5.8.0.0__1f131a624888eeed/Resources/ToolImages/YTICON.gif"

    Review the following online help article. There is explained how to set the icon for a custom button: http://www.telerik.com/help/aspnet-ajax/add_custom_buttons.html

    All the best,
    Stanimir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top