You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Tobias Reifenstuel <oe...@web.de> on 2008/08/01 17:14:17 UTC

[Tobago] tc:sheet problems

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?


Thanks and Regards,

Tobi Reifenstuel


 



Re: [Tobago] tc:sheet problems

Posted by Matthias Wessendorf <ma...@apache.org>.
On Fri, Aug 1, 2008 at 5:14 PM, Tobias Reifenstuel <oe...@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