I didn't read the question correctly. It indeed talks about showing progress for the generation process, not the download.
On Mon, Nov 18, 2013 at 10:39 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > Martin, > > Thanks for your comments. > > On Mon, Nov 18, 2013 at 9:10 AM, Martin Grigorov <mgrigo...@apache.org > >wrote: > > > Hi, > > > > I haven't seen a web application that shows progress bar for download. > > The browser itself shows such information - Google Chrome in the > > bottom-left corner, Firefox in its download window/manager. > > > > I'm not talking of a progress bar for download. I'm talking of showing a > progress bar for file generation (a file that takes too long to generate). > Once file is generated download will be triggered. I have implemented a > similar use case several times before. > > > > > 1-Replace the download link by an AJAX link. > > > 2-Launch file generation on a background thread. Pass a class to this > > > thread that serves as context fro passing information from generating > > > thread with web threads (keeping a reference to thisi context on the > > page). > > > 3-Make a progress panel visible + an AJAX timer that pols the server > for > > > progress. > > > > > > > Point 3) won't work if the file download is from a resource linked to the > > page. And it is thru DownloadLink. > > In this case the ajax timer won't be able to reach the page at all. > > > > ? Not following you. Page and thread generating the file will share a > context the file generating thread will use to update WEB threads about > status of generation (e.g. progress info). All the AJAX timer will do is > poll the page and ask for this information. Once file is generated timer > will disable itself and trigger download (or display a new panel with > download link). Again I have implemented something similar more than once > in my life. > > > > > > The app should use a mounted/shared resource. > > see wicket-extensions' UploadProgressBar and/or follow the progress of > > https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/262 for example. > > Both > > are related to *upload*, not download. > > > > Yes I know the limitation of serving resources from pages. Maybe one > variation of this is that the timer just points to the mounted resource in > order to trigger the actual download. That is not more difficult to achieve > that downloading from page. > > Shall I build a small mini app illustrating this? Maybe it can be useful to > other users? > > -- > Regards - Ernesto Reinaldo Barreiro >