1026
Views
11
Comments
Example of Lifecycle Event Handlers or how they work.

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

2022-10-17 06-51-09
Shweta Gedam

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

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,


I believe that what you want is this:

I believe that you can find all you need in this link:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events


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


2021-03-30 06-52-52
Ali Amin

Hi,

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

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

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

2023-07-23 14-37-01
Bad Code Guru

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.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

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.

Regards,

Daniel

2021-10-09 07-57-44
Stefan Weber
 
MVP

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

2023-07-23 14-37-01
Bad Code Guru

@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. 

2021-09-06 15-09-53
Dorine Boudry
 
MVP

is that not the OnRender right before the OnDestroy ?

2021-09-06 15-09-53
Dorine Boudry
 
MVP

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.