Skip to Content

How to add a line break to text property of the TimelineItem control in UI5 XML view?

The escape character '\n' and Unicode character \u000a will only work in JavaScript. However, I'm trying to add a line break in XML view as below. But doesn't work.

<code><u:TimelineItem text="First Line\n Second Line"/>

Note \n works as expected for Text control in XML as well.

<code><Text text="First Line\n Second Line"/>
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 07, 2017 at 06:16 PM

    this works for me:

    <Text text="line line\n line two" />

    <c:TimelineItem text="one one one\n two two" />

    make sure you declare the namespace for the sap.suite.ui.commons

    xmlns:c="sap.suite.ui.commons" in your view declaration

    Add comment
    10|10000 characters needed characters exceeded