How to create links on the column of table in SAPUI5

A simple example how to create links on table columns is based on Link – Subtle example.

  1. In the /mockdata/products.json for each ‘ProductPicUrl’ field value remove a host name ''.

  2. As a result the link in the column has got a host of the dev server, eg is 'http://localhost:8081/test-resources/sap/ui/documentation/sdk/images/HT-2001.jpg'

  3. In the Link.view.xml view change the first column content by adding
    a formatter function see Walkthrough Step 22: Custom Formatters:

          path: 'ProductPicUrl',
          formatter: '.hrefFormatter'
        }" />
  4. And implement the formatter in the Link.view.xml controller file:

    hrefFormatter: function(sUrl) {
        var mainUrl="";
        return mainUrl + sUrl;
  5. Using the formatter provides modified link URL: ''

Browse More Popular Posts

Leave a Comment