Rule Definition
If you override methods like onBeforeRendering, onAfterRendering, or getters and setters, the original methods will no longer be called. You have to make sure that you call them in your method explicitly. Even if they are not implemented right now, they could be added in the future. This applies to control inheritance in particular.
Remediation
Use "addEventDelegate" method.
Violation Code Sample
oControl.onAfterRendering = function() {
// do something
};
Fixed Code Sample
oControl.addEventDelegate({
onAfterRendering:function() {
// do something
}
});
Reference
https://sapui5.hana.ondemand.com/1.28.33/docs/guide/030fcd14963048218488048f407f8f34.html
https://sapui5.hana.ondemand.com/1.28.33/docs/api/symbols/sap.ui.core.Element.html#addEventDelegate
Related Technologies
Technical Criterion
Programming Practices - OO Inheritance and Polymorphism
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.