Generate bullets not working correctly

12 posts, 0 answers
  1. Steeve
    Steeve avatar
    17 posts
    Member since:
    Mar 2011

    Posted 11 Feb 2014 Link to this post

    Hi,

    My client want the option to have bullets in her text.  But when she select a part of text and click on "InsertUnorderedList", only one bullet is generated at the beginning of the text (for the entire paragraph).

    This behavior is also reproduced in your examples (and this editor).
    http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

    If the copy/paste this text:
    The services provided included <br>studies, <br>detailed design and complete project management services, <br>including specifications, <br>tender documents, <br>procurement, <br>inspection, <br>construction supervision <br>commissioning.

    and I select some lines and I click on "InsertUnorderedList", I have the following result:
    <ul><li>The services provided included <br>studies, <br>detailed design and complete project management services, <br>including specifications, <br>tender documents, <br>procurement, <br>inspection, <br>construction supervision <br>commissioning.</li></ul>

    My example is attached to this thread.

    So, I want to generate bullets only for the selected text (or for the line where the cursor is located)

    Thank you

    Steeve

  2. Steeve
    Steeve avatar
    17 posts
    Member since:
    Mar 2011

    Posted 11 Feb 2014 in reply to Steeve Link to this post

    Hi,

    I forgot to you mention that i'm working with the version 2013.3.1217.40.

    Thank you

    Steeve
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Christian
    Christian avatar
    7 posts
    Member since:
    May 2013

    Posted 11 Feb 2014 in reply to Steeve Link to this post

    A client of ours just pointed out this issue to us.We are using version 2013.3.1211.35

    It only happens when we try to select text and apply the bullets or numbers to the selected text.
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 12 Feb 2014 Link to this post

    Hi guys,

    This is not a bug, but an intentional change in the control that is described in detail here: http://www.telerik.com/help/aspnet-ajax/editor-inline-and-block-commands-behavior-change.html.

    Essentially, we are trying to make the RadEditor experience closer to that of desktop rich text editors (like MS Word) and they create lists out of block elements only. Thus, you should set the NewLineMode property to P to get the same behavior because it defaults to a line break.
    If you insert a line break in MS Word (ctrl+enter) you will see that it does not become a separate bullet.

    Thus, you may also find interesting this poll so you can leave your comment and cast your vote: http://feedback.telerik.com/Project/108/Feedback/Details/53978-poll-the-default-value-of-the-newlinemode-property-in-radeditor-should-be-p.

    The article I linked in the beginning also shows how you can get the obsolete commands back if you like, but note that they are no longer supported and we cannot guarantee there will be no issues with them, especially in modern browsers like IE11.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  6. Christian
    Christian avatar
    7 posts
    Member since:
    May 2013

    Posted 20 Feb 2014 in reply to Marin Bratanov Link to this post

    Thank you for the reply Marin.

    Actually, I don't see how this is bringing consistency to this feature.

    Try this example:
    1. Go into notepad and create a simple list of 3 lines (bullet 1, bullet 2, bullet 3)
    2. Next paste this example into MS Word
    3. Highlight the selection and apply bullets to the short list

    The whole thing works as expected and you get 3 bulleted lines.

    Now try the same thing in your editor.  You get a funky bullet, but not they way you can in Word.  It did not use to do it this way and I get the same results if NewLineMode is Br or P.

    Thank you,
    Christian
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 21 Feb 2014 Link to this post

    Hello Christian,

    This boils down to how each application considers new lines.
    Here is what happens in the case you described:
    1. Notepad has only one type of line breaks and no actual concept of paragraphs (it is simple text editing tool)
    2. pasting into word, however, generates paragraphs, because this is how MS Word operates, so you can get a list item per paragraph (that used to be a line in notepad)
    3. pasting in the browser causes the browser to determine what flavor the data has, and since it comes as plain text, it produces line breaks (<br /> tags), and this is what the browser sends to our code (RadEditor).

    You can confirm this logic in the attached video that explains the MS Word behavior and shows what HTML is pasted in a simple editable frame.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  8. Christian
    Christian avatar
    7 posts
    Member since:
    May 2013

    Posted 21 Feb 2014 in reply to Marin Bratanov Link to this post

    Marin,

    Thank you again for the reply.

    Despite all your explanations I still can't get back to the old way unless I revert to an older .js file (supposedly).  The dilemma we and other of your clients face is that we have to explain this to our clients.  There is no way that is going to happen using your explanation.  Our average client user is not that technical and probably does not care.  They just want it to work.

    The fact that you have all this transitional help means that you expected problems with this issue.  Why in the world haven't you given your clients a better work-around then "this is the way we are doing it now".  The issue is with the paste.  Why not have a way to convert to the paragraph tag for pasted or existing text in my case.  There is no such toolbar item like this that i am aware of.

    This is extremely frustrating since I have to spend time with the client finding a work-around for something that used to work. I think Telerik has handled this badly.  My clients have to wait until we figure something out, and then they have to wait for our release cycle since we do not deploy on a whim.

    Thank you,
    Christian
  9. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 24 Feb 2014 Link to this post

    Hello Christian,

    Software has to evolve in order to match the expectations and provide better experience for the majority of our clients. Getting the behavior closer to that of MS Word has been requested very often and we have heeded this request.

    We are aware of the fact that there will always be people who prefer the old behavior and that some users may not be content with the new way, which is why we extract old commands and offer this file - so that developers can revert to the old commands for the old behavior, should they choose to.

    Thus, it will, perhaps, be your option of choice in this matter.

    Setting thew NewLineMode to P will have your users using the control as before, but with more semantic content and with the way MS Word behaves.

    On pasting - there are various ways to handle this and our priority is to not modify the content the browser-user-other software combination provides. We cannot know all possible combinations, requests, desires and preferences, which is why we apply as little modifications as possible. If paragraphs come in from MS Word, paragraphs will be pasted. If line breaks come in - line breaks it is.

    If a user pastes line breaks into MS Word they will not be able to create lists as it is, and they would need to go and press enter before each line they want to make a separate list item. If NewLineMode=P in RadEditor, the same process will yield paragraphs and lists will be created as in MS Word.

    This is why the OnClientPasteHtml event exists - so developers can customize the content before it enters RadEditor. Here is a small example that will convert break tags to paragraphs:

    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="replaceBreaks">
    </telerik:RadEditor>
    <script type="text/javascript">
        function replaceBreaks(sender, args)
        {
            var updatedContent = "";
            if (args.get_value().indexOf("<br") > -1)
            {
                updatedContent = args.get_value().replace(/<br\s*[\/]?>/gi, "</p><p>");
                updatedContent = "<p>" + updatedContent + "</p>";
                args.set_value(updatedContent);
            }
        }
    </script>

    and you can extend this further to match your needs if you like.

    With all this we have offered improved experience for the majority of people while leaving a number of options for the rest. This is more than most breaking changes in software offer as alternatives, for example AjaxControlToolkit's script manager incompatibility. We do care for our clients and we try to make transitions as easy as possible.

    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  10. Steeve
    Steeve avatar
    17 posts
    Member since:
    Mar 2011

    Posted 17 Mar 2014 in reply to Marin Bratanov Link to this post

    Hi Marin,

    I update telerik to version 2013.3.1217.40 and set NewLineMode property to P and it works well.

    Thanks for your time!

    Steeve
  11. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3599 posts

    Posted 17 Mar 2014 Link to this post

    Hi Steeve,

    It is good to hear this works well for you. In this case, I would like to bring to your attention this poll: http://feedback.telerik.com/Project/108/Feedback/Details/53978-poll-the-default-value-of-the-newlinemode-property-in-radeditor-should-be-p.


    Regards,

    Marin Bratanov
    Telerik

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

  12. gaurav
    gaurav avatar
    1 posts
    Member since:
    Jan 2015

    Posted 03 Jan 2015 Link to this post

    My client want the option to have bullets in her text.  But when she select a part of text and click on "InsertUnorderedList", only one bullet is generated at the beginning of the text (for the entire paragraph).

    This behavior is also reproduced in your examples (and this editor).
    http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

    If the copy/paste this text:
    The services provided included <br>studies, <br>detailed design and complete project management services, <br>including specifications, <br>tender documents, <br>procurement, <br>inspection, <br>construction supervision <br>commissioning.
    Telerik editor version 010.3.1109.35

    How to solve this issue 
  13. gaurav
    gaurav avatar
    1 posts
    Member since:
    Jan 2015

    Posted 03 Jan 2015 Link to this post

    Unable to solve this issue not generate  bullet list on whole item.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017