JSF RI Sandbox FileDownload Component Changes

January 11th, 2007

Today I checked in a couple of changes to the RI Sandbox file download component that will make the component more flexible, and, therefore, more usable.

Before these changes, the only way the component could be used was with one of two “methods:” “inline” (e.g., a PDF embedded in the page), or “download” (which was a link with a text anchor). While this worked, it was pretty limiting. What if the page author wants the link to be a picture, or if he wants the file download to start from on onChange even handler? Before today, that wasn’t possible. Today, though, I committed support for child components, as well as support for creating an EL variable that can be used by any child components as they please.

With the first change, something like is now possible:

which will render an anchor, using the the download.jpg image as its content, that will deliver the HelloWorld PDF to the client when clicked. (In theory, anything can be used inside , though I’ve only tested with text and images.)

But what if you want a dynamically generated image to be displayed? With the second change, this is now possible:

This simple example will render an image on the page, pulling the contents of the image from TestBean.getImage, and should the user try to save the image, the filename defaults to “image.jpg.”

If you don’t like the variable name downloadUrl or if it would clobber one already set, you can specify the name of the variable with the urlVar attribute:

Fancy.

At IEC, we’re pretty excited about these changes. We’re using both the download and multi-file upload components in a couple of different high profile projects, which means that they’re stable enough for production, and they also get a good deal of real world scrutiny, resulting in changes like these above.

These changes can be picked up from the RI CVS HEAD branch.

Thoughts? Complaints? Suggestions?

Popularity: 9% [?]

3 Comments

  1. vguna says

    Hi.

    It would be fine, if there would be some screenshots for the multiupload component for example.
    Also a link to the jsf-ri (perhaps nightlies?) sandbox would be helpful :).

    Great job!

    Regards,
    Veit

    January 30th, 2007 | #

  2. jason says

    I’m currently working to get the demo app hosted on a public and stable web server, so you can play with it. There are some screenshots in this blog entry. A Wordpress upgrade broke the image references, but I have fixed that. Thanks for pointing that out.

    The JSF RI can be found at here, and a snapshot of the Sandbox can be found here. It’s a manual process (as far as I know) to update the Sandbox download, but I’ll do my best to keep it current.

    January 30th, 2007 | #

  3. vguna says

    Sounds fine!

    Under which license do you offer the components? Can one use these and modify them as needed?
    I would miss things like JUpload offers: LookAndFeel of the system, nice little icons on the buttons perhaps another
    gui presentation…

    Regards,
    Veit

    January 31st, 2007 | #

Sorry, the comment form is closed at this time.

With many thanks to Kaushal Sheth
`