Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

util.Formatter.js function in JS View

Hi Expert.

I am trying to complete "Building SAP Fiori-like UIs with SAPUI5" exercise 3 in JS view.

I have problem in calling statusText function of util.Formatter.js in my Detail.view.js.

The original exercise is in xml view.

Below is my codes..


myFioriApp.util.Formatter = {

statusText : function(value) {

var bundle = this.getModel("i18n").getResourceBundle();

return bundle.getText("StatusText" + value, "?")




sap.ui.jsview("myFioriApp.Views.Detail", {

getControllerName : function() {

return "myFioriApp.Views.Detail";


createContent : function(oController) {

var oHeader = new sap.m.ObjectHeader({

firstStatus: new sap.m.ObjectStatus(


formatter: function(s){

return myFioriApp.util.Formatter.statusText(s)



Function statusText() did get called but (this.) does not have an instance of text control therefor it fails to call getModel() function of it's aggregate.

Thanks in advance for your reply.

Former Member
Not what you were looking for? View more on this topic or Ask a question