myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: [Tobago] tc:sheet problems
Date Fri, 01 Aug 2008 15:23:54 GMT
On Fri, Aug 1, 2008 at 5:14 PM, Tobias Reifenstuel <oeler1@web.de> wrote:
> Hi all,
>
>
> i used the <tc:file /> tag to upload files. This works fine. Now I want to
> download this file and I don't know how. Is there a comfortable way to do
> that? Something similiar to the upload process? I want to use the normal
> windows from the OS to save the files. If I can't do it with tobago, how can
> I implement it with jsf?

Hi,

in trinidad we have an actionListener for that.
The core code is not tied to Trinidad, so you could "borrow" it (see [1]).
Ignore those Trinidad specific imports the core is pretty much independent.
processAction() is what you are looking for. You can create a TAG as well
and use it like:

<h:commandButton value="Say Hello">
  <myLib:fileDownloadActionListener filename="hello.txt"
      contentType="text/plain; charset=utf-8"
      method="#{bean.sayHello}"/>
</h:commandButton>

See [2] for more documentation.
And yes, that would be a nice tag in the commons lib.

HTH,
Matthias

[1] http://svn.apache.org/repos/asf/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/listener/FileDownloadActionListener.java
[2] http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_fileDownloadActionListener.html
>
>
> Thanks and Regards,
>
> Tobi Reifenstuel
>
>
>
>
>
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Mime
View raw message