Skip to Content

Using HTML in Fragments

Hi,

I have a requirement where i need to display some text in HTML format, to be more clear it should be an ordered list, design of my app is:

User clicks on Edit mode he will get a pop up which is a Dialog once he clicks on save a XML Fragments is called, I am aware that this can be done using formatted text however we are using lower version than below.

Application Component: CA-UI5-CTR Available Since: 1.38

As formatted text is available since 1.38, i can't use this feature, any pointers will help, i have searched on SDN and did not find anything related to my requirement or may be i am not smart enough to understand.

I am not an expert in JavaScript and finding it difficult how to implement the solution.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 02, 2017 at 10:09 PM

    You can use sap.ui.core.HTML element inside a fragment. Check the explored link

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 02, 2017 at 10:38 PM

    Hi Srikanth,

    This does not work with the fragments, i have already tried it.

    Add comment
    10|10000 characters needed characters exceeded

    • It still works, test this with version 1.28

      Below are the steps I followed:

      Step 1: Downloaded Walkthrough tutorial(step 17) from Explored app(as this contains fragment) and changed the version in index.html to 1.28

      Step 2: Create a normal HTML in a notepad anywhere that you want to show, and escape HTML tags using this link

      For testing I have used a sample HTML document which looks like below:


      Step 3: use this escaped HTML from step 2 in Dialog fragment for UI element sap.ui.core.HTML

      Output:

      indexhtml.jpg (49.9 kB)
      escape-html.jpg (169.2 kB)
      fragment.jpg (50.5 kB)
      output.jpg (19.6 kB)