Reputation: 449
I was working with Controls in SAPUI5 and saw events like onBeforeRendering and onAfterRendering on them; I supposed a Control was rendered only one time (in the initial loading of the page); However, are there other occasions that re-render a control without full a page reload? And in what occasions makes sense to re-render a control? How it is useful to the developer? Thanks in advance!
Upvotes: 2
Views: 4936
Reputation: 311
A control is usually re-rendered when
To be precise, any of the above only invalidates the control which tells the UI5 runtime core that re-rendering is necessary (which then happens asynchronously for performance reasons).
Depending on the implementation, re-rendering can be suppressed. E.g. the sap.m.Text
control doesn't invalidate the control when the text
property changes but just manipulates its DOM directly.
For the the majority of scenarios, you don't need to worry about re-rendering. It's being taken care of by the UI5 runtime. In fact, for most scenarios, when you need to explicitly re-render/invalidate a control, there's probably something wrong with your implementation.
Upvotes: 5