Using OpenUI5/SAPUI5, per documentation on XML Binding Expressions, we have the ability to execute a function from the view.
new sap.m.CheckBox({
selected: "{= checkSelectedItems(${odata>CustomerId}) }"
})
In my controller behind the view:
checkSelectedItems: function(sCustomerId) {
return true;
}
In my view, I get the generic error as if it cannot find my function:
Uncaught TypeError: Cannot read property 'apply' of undefined
I've tried calling the function in several ways:
{= .checkSelectedItems() }
{= my.namespace.checkSelectedItems() }
I even tried adding a function in a script tag in my index page to see if it only has access to global functions, but I wasn't able to trigger that either. Suggestions? Am I misinterpreting the documentation?
Please see the JS Bin here : http://jsbin.com/sosotacihi/edit?html,output. I've commented out the CheckBox that has the issue, but if you put it in, you'll see the error.