Skip to Content
author's profile photo Former Member
Former Member

Creating global event for sap.ui.core.Element or sap.ui.core.Control classes in SAPUI5

I would like to create a event, that would be borrowed by every Element and/or Control that is extending these core classes. Normally I would extend a control (the child to sap.ui.core.Element or sap.ui.core.Control) and add the event to its metadata, but since this is gonna be applied to various controls across the app, I would have to create a lot of custom controls, which is not the case. Is there a simple way to add an event to a class (and therefore its children)? I could achieve the same effect if there would only be something like a "onBeforeRender" event (which existence I'm not aware of) for every Control. I'm using XML views. Is adding custom events to the sap.ui.core.Element or sap.ui.core.Control overally a good thing?

Add comment
10|10000 characters needed characters exceeded

0 Answers