So what I'm trying to do must surely be a common thing... yet so far I have
had no luck getting it to work.
I'm generating big PDF's on the server .. and in the browser I have a link
that should initiate that generation and bring up a file 'save-as' dialog
when the PDF is ready to be downloaded. While the generation phase is going
on, I want to use jQuery.blockUI to stop the user from doing anything else
in the app.

I've got two issues:

1. Wicket.Ajax.Get is asynchronous by default, so the 'success' callback
gets hit right away. I'm using a decorator (as described in Igor's cookbook)
to block/unblock the UI via jQuery.blockUI. The ajax call fires off and
comes right back, unblocking the UI well before the PDF generation finishes
(I kick that off in the ajax link's onclick handler). If there is a way to
make the ajax call synchronous 'on the fly', then this problem would go
away. I know how to do it in pure jQuery, but I don't know how to do it 'the
wicket way' .. I looked at AbstractDefaultAjaxHandler and i'm currently
studying the wicket javascript code, but if somebody knows a way to do this
please do let me know .. :)

2. ByteArrayResource .. is somewhat inconvenient (for me)..  The filename
member is private final and you can only set it at construction time. You
can provide the byte[] whenever you like though. This seems odd to me..
because if you are overriding getBytes() you probably are doing that because
you didn't have the byte content at construction time and, if you are doing
what i'm doing, ie creating a file and getting the bytes from that, you
probably wouldn't have the filename of the file until post-construction time
either... I think there should be overrides for both the bytes *and* the
filename...?

TIA





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ajax-file-download-tp4652911.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to