dont take this liteteraly but here it is

add(new Link("link) {
        onclick() {
           String txt=generatefile();
           WebRequestCycle.get().setResponseTarget(new ResponseTarget() {
                  void respond() {
                     WebResponse r=WebRequestCycle.get().getResponse();
                     r.setAttachmentHeader("filename");
                     Streams.copy(new StringInputStream(txt), r.getOutputStream );
            }
      }
}

-Igor

                   



On 7/11/06, Levy, Jeremy < [EMAIL PROTECTED]> wrote:
I would like to create a text file on the fly and then create a link which will initiate a download of this file.
 
I checked out the example at http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images .  I am thinking that I can do something similar but extend DynamicWebResource.  Then use ResourceLink to link to it... Would this work?  Is there a better way to do it? 
 
J
 
 
 

Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to