on 07-28-2017 8:48 PM
Hi to all,
I'm trying to use a formatter function in my app to give format to an sap datetime data, when I declare it in controller file it works fine, but when I try to call it from formatter file I get message: "formatter function .formatter.toTime not found!".
This is my file definition:
This is how I prepared it in my controller file:
this is how I call it from my view:
And finally, this is the message that I receive :
Does anybody could help me to find the cause of this issue ?
Greetings,
Moisés.
The order of the items you are importing and the order of the dependency injections must match in your controller. Try switching 'MessageBox' and 'formatter.' That worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this probably will solve the problem
Moises Gomez Quintero thanks for the help resolved my issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to all of you, Per Bengtson I´m gonna do changes in code and test it again,
Greetings !!.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
//To clarify for us beginners; declarations in "sap.ui.define" and
// "function" must have same sequence.
// Eg here is "formatter" last in both cases, works very well.
//Below are the first lines from "View1.controller.js" as an example
sap.ui.define([
'jquery.sap.global',
'sap/m/MessageToast',
'sap/ui/core/Fragment',
'sap/ui/core/mvc/Controller',
'sap/ui/model/Filter',
'sap/ui/model/json/JSONModel',
'myApp/model/formatter'
], function(jQuery, MessageToast, Fragment, Controller, Filter, JSONModel, formatter)
"use strict";
return Controller.extend("myApp.controller.View1", {
formatter: formatter,
onInit : function(){...
<br>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am also facing the same issue. Getting an error that function in the formatter is not found. Anyone found the solution for this issue?
Regards
Karthik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I got same issue, did you have solve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
same issue im facing now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1.check if the formatter js is loaded.
2. "formatter" is used both as key and value, can you change that?( not sure if it matters)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.