cancel
Showing results for 
Search instead for 
Did you mean: 

Formatter is not working

Former Member
0 Kudos

Hi All,

I'm trying to format values using formatter in table but it is not working and empty values are showing in table.

Please see my code and resolve my issue

In View:

.........

<items>

  <ColumnListItem press="onPress">

  <cells>

  <Text id="otext1" xmlns="sap.m" text="{value1}" />

  <Text id="otext2" xmlns="sap.m" text="{path:'value2' ,

  formatter : '.formatter.converter'}"/>

  <Text xmlns="sap.m" text="{value2}" />

  <Text xmlns="sap.m" text="{value3}" />

  <Text xmlns="sap.m" text="{value4}" />

In controller:

sap.ui.define([ "sap/ui/core/mvc/Controller", "chartswithxml/formatter" ],

 

function(Controller, formatter) {

  "use strict";

  return Controller

  .extend("chartswithxml.S1",

  {

  formatter : formatter,

  onInit : function() {

  var oModel = new sap.ui.model.odata.ODataModel("Odata model/");

  this.getView().setModel(oModel);

.........

Finally formatter.js

sap.ui.define([], function () {

  "use strict";

  return {

  converter : function (sConverter) {

  //var s = this.getView().getModel().getData();

  return sConverter/1000;

  }

  };

});

View Entire Topic
Former Member
0 Kudos

Hi,

I resolved this issue by adding 'data-sap-ui-xx-bindingSyntax="complex"' to the bootstrap of SAPUI5 in index.html.

Regards,

Sai Ram Dinesh Pallapotu