you could use t:async="true“ instead and return the pdf along with some custom 
script that re-activates your button.
the binary of the pdf could be passed into FileSaver[0] to create the 
save-file-dialog of the browser. while all this happens you could show a 
progress indicator to the user.

if you find this too complicated you could keep the traditional requests but 
maybe open a popup that triggers the download.

[0] https://github.com/eligrey/FileSaver.js

> Am 27.03.2017 um 10:36 schrieb g kuczera <gkucz...@gmail.com>:
> 
> Hi everybody,
> I have an actionLink, which action returns the pdf document from the
> server. The document is dynamically generated, so it can take few seconds
> to deliver it to the user. I want to prevent the user from clicking on the
> actionLink multiple times. I can block it in java script after the click
> event occurrs, but I don't know how to find out when to unblock it.
> 
> Is there a way to find out when the document is received by the user and
> then unblock the actionLink? I found one possible solution, but it seems
> like an overhead:
> http://stackoverflow.com/questions/1106377/detect-when-browser-receives-file-download
> Is there a more tapestry way to do it?
> 
> Here is the actionLink code:
>                                    <t:actionLink
> t:id="downloadDocumentAsPdf" context="document.document_id"
>                                        target="_blank">
>                                        ${message:download.document.as.pdf}
>                                    </t:actionLink>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to