Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Download files component

 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there a component/sample code to download files from a web page using JSF?

Please advice
 
Jason Lee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mary Cole:
Hi,
Is there a component/sample code to download files from a web page using JSF?

Please advice


Off hand, assuming I understand your request, I know of two such components. One is my own download component in the Mojarra Scales project: https://scales.dev.java.net/#download with a live demo here: http://jsftemplating.org/mojarra-scales-demo-facelets/download.jsf

RichFaces/Ajax4Jsf also offers a4j:mediaOutput: http://labs.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/RichFacesComponentsLibrary.html (section 6.12) and a live demo of that here: http://livedemo.exadel.com/richfaces-demo/richfaces/mediaOutput.jsf
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get much info from both the sites...actually, I have a filename (.pl or .zip , or .doc) with a hyperlink ( a command link ) to it on the web page..on click of the link, it should call the method on the bean to get the file contents and display the save open dialog box so that the user can view or downlad the file.. if possible I would prefer not to refresh the page..Ajaxit

any suggestions?

[ March 25, 2008: Message edited by: Mary Cole ]
[ March 25, 2008: Message edited by: Mary Cole ]
 
Ketan Jambhekar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i dont think you need any special components to acheive this functionality.
You can use the link as a commandLink and call a method which does the following


You need to write your own custom methods whereever applicable in the above scenario.

Thanks,
Ketan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic