Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

dowloand report - status on page  RSS feed

 
bostian tov
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have hutputLink that calls method, that creates pdf report and opens file window, so we can save or open file. Is it possible to
somehow display some loading icon, until pdf is not prepared. Because it takes couple of second to do this.

a4j:support status="globalStatus" event="onclick" has no use, because onclick event is finished emidiatly...
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can only do this if you pass off the process of creating the PDF to a worker thread and use polling to interrogate the worker thread for status. And DON'T spawn the worker thread from the JSF request! Create the thread in advance at the application context level and make the JSF processor queue the request via a synchronized object.

The reason you can't do this directly is because HTTP doesn't maintain continuous communications. It works on a request/response basis, and the response all comes back at once so you'd always get a long delay on the status and the status would always say "100%".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!