Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File Download and page navigation  RSS feed

 
Ian Waghorne
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if anyone could help me?

I�m new to JSF (in fact Java), and I�m having problems implementing a feature.

Currently we�re providing a link on a page to allow a user to download a file onto their local machine, which I�ve successfully built, resulting in a Save As dialogue box being displayed by the client.

My problem is I need to find a way of automatically navigating the user to a confirmation screen once the download has been completed. There are some good reasons for this, which I won�t bore you with.

I�ve tried setting up a navigation rule in the faces-config.xml. But all that happens is the client�s browser simply gets direct to the confirmation screen without downloading the file. The same happens with a redirect.

Is automatic navigation possible after a file download is complete?

Many thanks for any advice/help offered!

Ian.
 
Bob Good
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you in the browser in javascript when the download completes?

If so you can do the following:

1) set up a hidden button with an action method to invoke a backing bean action, something like this:



2) in BackingBean.navAction method return a string to trigger navigatyion in the usual manner.

3) When the download is complete, trigger the navigation from javascript:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!