Skip to Content
0
Former Member
Nov 07, 2014 at 03:21 PM

Replace value of Binding by oController-method

21 Views

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?