68
Views
4
Comments
Solved
OnDestroy Action stops after Refreshing Data
Application Type
Reactive

Hello,

in my Web-Application i have a Client Action that is triggered On Destroy (when leaving the screen), that stops right after the Refresh Data element. I checked with the Message element, the stopping point is definitely Resfresh Data. Now, if i trigger this Client Action with a button, it runs as expected. Only when it's triggered by leaving the screen, it will start and then stop right after the Refresh Data. Anyone got an idea why, or how i could fix that?

Thanks

2025-12-15 09-29-24
Thibaut G
Solution

Hi Michael,

You might want to have a look at the Screen And Block Lifecycle documentation to better understand what is happening.
The sequence of screen and block events might not be as you expect it to be.
The onDestroy from the old screen will be executed later than screen events from the new screen.

Hope this helps

Kind regards

Thibaut 

2024-07-03 13-47-21
Michael Rauschelbach

Thanks Thibaut, i understand it better now. I'll find another way to do this.

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

I did some testing based on this question :

  • I can confirm it stops after a refresh
  • It doesn't stop after a 'normal' server call

The intention of a dataAction or Aggregate is to retrieve data to be displayed in the screen, so it doesn't really make sense to refresh that in an OnDestroy.

Dorine

2024-07-03 13-47-21
Michael Rauschelbach

Yes, i was trying to 'clean up' unused data when leaving the screen. Instead i'll try to work with Screen Variables and keep my data clean from the start. Like you said, it does not make sense to fetch data for a screen that is being 'destroyed'.

Thanks anyway for checking!

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