Formatter Function Not Found - SAP UI5 [closed]

2019-09-26 07:22发布

问题:

I am facing an issue in formatter. I have a function inside a formatter. When I call the function, it says " .formatter.checkFunc() not found.!. I have included all necessary files in the controller. But not able to find the cause of the issue.

View :

<Text text="{parts: ['value'], formatter: '.formatter.checkFunc'}"/>

Controller :

sap.ui.define([
"XX/controller/BaseController",
"sap/ui/core/mvc/Controller",
"sap/ui/model/Filter",
"sap/ui/model/FilterOperator",
"XX/model/formatter" ],
function(BaseController, Controller, Filter, FilterOperator,formatter)
{ "use strict"; return BaseController.extend("XXXX.controller.Sourcing",
{

formatter: formatter,

回答1:

Looks like that you call the formatter instead of specifying it:

it shoudl be ".formatter.checkFunc", but not ".formatter.checkFunc()"