This is about the life cycle of a control in SAPUI5.
Understand the life cycle and its hooks.
Let’s get started!
Life Cycle of a Control in SAPUI5 and Its Life Cycle Hooks
SAPUI5 has several life cycle hooks in its controls. The SAPUI5 framework calls those life cycle hooks automatically to certain points in the life cycle of an SAPUI5 control.
The life cycle hook methods of an SAPUI5 control are, and therefore, its life cycle is:
- onInit: Called after the init method of the inherited element of the control is executed. Initializes the control after creation.
- onBeforeRendering: Before the rendering of the control is started. Called before every rendering or re-rendering.
- onAfterRendering: After the rendering of the control is completed. Called after every rendering or re-rendering.
- onExit: Called after the destroy method of the inherited element of the control is executed. Cleans up the control instance before destruction.
Here is the life cycle of a controller is in SAP UI5.
And here is the order an application executes in SAP UI5.