Skip to Content
0
Apr 12, 2016 at 06:02 AM

Call Controller Function from Handler Press Event

1416 Views

Hi,

I have this code:

var oItem = new sap.m.ObjectListItem({
     id: "mainListItem",
     //press: "onSelectionChange",
     press: function(oEvent){
     this.onSelectionChange(oEvent);
     },
     type: "Active",
     title: "{Description}",
     number: "{Activity}",
});

But de application displays this error:

Master.controller.js:47 Uncaught TypeError: this.onSelectionChange is not a function


I used the code press: "onSelectionChange",but display this error:

sap-ui-core.js:143 Uncaught TypeError: I.fFunction.call is not a function

The onSelectionChange method exits in the View controller (BaseController). The application is a template of SAP Fiori Master / Detail 1.28.

Best regards,

Johnny