In the SAPUI5 Developer's Guide, I found this event handling note:
Event handling in XML views. Event handlers are used as attributes. An attribute name is an event name, such as a βclickβ for a button, and an attribute value as the name of an event handler. An event handler must be defined as a function in the view controller. To attach an event handler in the XML view, insert the following declaration: ... <Button text="Press Me" press="doSomething"/> ... The controller.doSomething() method is executed when the button is clicked,
In my XML view, I can translate this to:
<Select change="doSomething">
When the value for the selection changes, the controller.selectOnChange function is called with "this argument associated with the controller itself." However, when I bind this event handler in a JavaScript view, "this argument is bound to a select item."
I assume this translates to the following code for my JavaScript view:
new sap.m.Select({ change : oController.doSomething })
Am I binding the event handler incorrectly?
source share