cancel
Showing results for 
Search instead for 
Did you mean: 

Replace value of Binding by oController-method

Former Member
0 Kudos

Dear all.

I'm a rookie and of course I stuck in the mud...

When I wanna manipulate the value coming from a binded Model, I'm doing it that way:

new sap.ui.commons.TextView({ textAlign : sap.ui.core.TextAlign.Center }).bindProperty("text", "MATNR", oController.toNumber)

In Controller-Method toNumber I can manipulate the value, eg:

toNumber: function(value) {

  var number = Number(value);

  var result = number.toString().replace(".",",");

  if (result == '0') result ="";

  return result;  },

That's easy

Now I'm using a dataset for a graph:

var dataset = new sap.viz.ui5.data.FlattenedDataset({

        dimensions : [ { axis : 1, name : 'Dimension', value : "{DESCR}" },

                       { axis : 2, name : 'Wert',      value : oController.setStatus( "{STATUS}" )} ],

          measures : [ { name : 'Capacity', value : '{PART2}' } ],

            data : { path : "/RESULT/GRAPHICS" }});

but

value : oController.setStatus( "{STATUS}" )


is not working. The method always receives the string "{STATUS}" instead of the binded value.


Any idea?

Accepted Solutions (1)

Accepted Solutions (1)

former_member91307
Contributor
0 Kudos

Hi Carsten,

Use the below line

value:{path:'status',formatter:'oController.status'}

Thanks and Regards,Venkatesh

Former Member
0 Kudos

Perfect. That's it. Thanks a lot!

Answers (0)