How is your experience with the OutSystems Community?
16
Views
5
Comments
Issue - Loader along with the 'Download' button in a traditional web app

In a traditional web application,

I am using a container which has a loader in it, and it is getting triggered by using the Boolean variable.

Unfortunately, it is getting triggered, but it is disappearing from the screen in less thana second as the Ajax refresh is resetting the value and after that widget, I am downloading the PDF document in the preparation action of another screen by using the download widget.

I want my loader to stay visible until the downloading has not been finished.

2025-11-18 12-43-07
Mariana Junges
Champion

The loading indicator disappears quickly because it's controlled by a boolean variable that is reset after the Ajax update, while the PDF download is subsequently initiated by the browser via the Download widget or navigation to another screen. 

Since the framework doesn't provide a native event to detect when a file download is complete, it's not possible to keep the loading indicator visible until the download is fully finished. 

The most common approach is to display the loading indicator while the PDF is being generated on the server and hide it as soon as the response starts being sent to the browser, usually using JavaScript (e.g., with a hidden iframe or a callback mechanism) to manage the indicator's visibility more effectively.

Let me know if this helped.

2023-06-19 05-11-46
Ashutosh Tarey

Hello @Mariana Junges , I understood your point, can you share the JS code which I need to implement in my action flow? 

2026-06-05 12-38-17
Eduardo Jauch

Hello @Ashutosh Tarey 

In Traditional Web Applications, an Ajax submit allows you to use the Ajax Refresh to rebuild specific parts of your screen,

It is a long time since I worked with them, but if I remember, when you use an Ajax Refresh, its effect is immediate (does not wait to be returned only after the end of the request).

If that's true, you can call your Screen Action with an Ajax Submit, at the start, do an Ajax Refresh to make the Loading Indicator to appear, start processing the PDF, and once it is done, before returning it in the Download Node, do another Ajax Refresh to hide the Loading Indicator...

This would make using Javascript not necessary.

Do you think this could work in your case?

Cheers!

2023-06-19 05-11-46
Ashutosh Tarey

Hello @Eduardo Jauch, I have already implemented this solution before. But the loader is getting disappeared in a second in this case, I want the loader to be visible until the PDF document has not been downloaded.


Regards,

Ashutosh Tarey

2023-06-19 05-11-46
Ashutosh Tarey

Hello @Mariana Junges , is there any alternative other than a loader which I can use in my case that can act as a loader?

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