Skip to Content
Former Member
Aug 13, 2015 at 09:33 AM

How to override prototype method of a control


Hi experts,

Suppose for example,i am using sap.m.Button it already have an event

Button.prototype.ontouchstart = function(oEvent) {

// mark the event for components that needs to know if the event was handled by the button


// change the source only when the first finger is on the control, the

// following fingers doesn't affect

if (oEvent.targetTouches.length === 1) {

// set active button state


// set target which started the event

this._target =;



If i want to add any new logic of mine inside this function . what should be my approach. I am new to ui5 please help. Dennis Seah's Profile | SCN kindly help.