On the Front End Practice test on the Outsystems training this question is posed
My question is why is the answer the OnRender and not OnReady, but on the documentation i thought it said we are to add Event Listeners OnReady
Hi @Isaac Wangombe ,
Great point I don't think this answer is correct at least not with the "OnRender" event only. The on Ready event handler runs when the Screen or Block is ready, i.e. when the DOM is ready which makes this the ideal place to:
The on render can have the exact same use cases but also extra ones like acting on data changes since this event can be triggered multiple times while the On Ready can't. According to best practices the best place should be during the "On Ready" event because even though it should work during the "On Render", in my perspective, you don't want to keep spamming the same event listener logic every time there is a data change or worst build custom logic to avoid it. So I am with you, that answer is not the appropriate one.