Hi All,
Can any one guide me on How Lifecycle Event Handler works.?
Example on below events, Why to use, When to use, and How to use? with little description.
On Initialize
On Ready
On Render
On After Fetch
On Parameters Changed
On Destroy
Flow Diagram or any OML will really helpful if some one can show simple and easy use of these events.
Really thanks.
JK
Hi JK2020,
You can go through following documentation and video link to get the knowledge on how lifecycle events works:
https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events
You will find more detailed explanation and examples of events from the given video link:
https://www.outsystems.com/training/courses/121/blocks-and-events/?LearningPathId=18
Hope this works, Thanks
Hi,
I believe that what you want is this:
I believe that you can find all you need in this link:
In there you have a full explanation about this topic and a table with all the events and their description.
Hope this can help.
Best regards,
Ricardo M Pereira
Just to highlight more about onparameter change event.
It triggers every time you change the value of a data element of a Screen or Block and after that render event will be called.
it will not triggers the Oninitialize or OnReady Event again.
Cheers,
Ali Amin
You can go through the below link.
Hi Ajay,
Not only are you replying on an old post, but the answer that you give, was the first reply to the question on 2020-12-24.
Regards,
Daniel
FYI: OnRender never fires in the Layout when you navigate to different screen with the same layout. This is OS bug, OnRender MUST be fired because DOM is changed.
Hi Dmitry,
Awakening an old discussion from 2021, is not the best way to inform OutSystems about something you consider a bug.
Best would be to either create a new question, and share any relevant information and links (like this discussion), and also use the Feedback button in OutSystems Service Studio.
Hi Dmitry
i tried to reproduce your issue and added an OnRender event handler to a layout and created two screens linking to each other. In my case the OnRender handler gets triggered every time. As Daniel suggested you should reach out to OutSystems via the Feedback button.
Best
Stefan
@Stefan Weber Hi, Thank you for your reply.
Are you sure you are talking about OnRender when you navigate to the 2nd screen which is using the same layout? Im my case the all lifecycle is OK when I am at the 1st screen:
Init -> OnReady -> OnRender.
After navigation I see the following cycle:
Init -> OnReady -> OnRender -> Destroy (old one) -> ... and here is no OnRender ...
But it must be something after OnDestroy, because DOM is changed and new render is came. I suspect OnDestroy (old one) should be fired before. Imaging a use-case when you remove js event listener onDestroy, which is created in Onready.
@Daniel Kuhlmann Hi. Yes, you are right.
But I did a quick workaround, and don't need any help on this. I left this comment in this old thread in case someone is looking for an answer like me. In this case it might be helpful.
Thank you guys.
is that not the OnRender right before the OnDestroy ?
yep, as expected
just did the test, that Render you see there before the Destroy, is the one for the new screen
here's result of flowing between 2 screens, AAA and BBB