26
Views
4
Comments
[Confirm Unload] How to use?
confirm-unload
Reactive icon
Forge asset by Caio Santana Magalhães
Application Type
Reactive

Hi Caio,


Could you provide a sample to knows how to use this component, please?

2023-06-05 15-54-04
João Correia

Hi Leandro,


See the attached demo for an example of how to implement this component.

In this demo, the component is included in the screen's OnInitialize which sets up the event listener that shows a confirmation dialog when navigating to another page or refreshing, for example. 

ConfirmUnload Demo.oap
2021-08-30 15-28-09
Leandro Correa

Let me check it!

Thank you, João! 

2021-08-30 15-28-09
Leandro Correa

Is there a way to prevent browsing to another screen or logging out of the application?

2023-08-25 08-57-29
Johan den Ouden

The problem is the before unload doesn't run when the user navigates to different screen in the sample reactive application because it's a single page application so the page is not unloaded.

I haven't found a solution for that yet. 
If someone knows a solution please let me know.

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