You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ricmancio <ri...@gmail.com> on 2012/01/19 10:06:30 UTC
Download Link doesn't work on 1.5.x
In Wicket 1.4.x I used
Link link = new Link("download"){
@Override
public void onClick() {
*IResourceStream stream = new FileResourceStream(new File(path +
fileName));
getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream)
.setFileName(fileName));*
}
};
*
After migration on 1.5.x what code should I use?*
I'm trying with:
....
*getRequestCycle().scheduleRequestHandlerAfterCurrent(new
ResourceStreamRequestHandler(stream)
.setFileName(fileName));*
...
but doesn't work
tnk
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309507.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
Posted by ricmancio <ri...@gmail.com>.
no question, *I replaced:*
Link link = new Link("download"){
@Override
public void onClick() {
IResourceStream stream = new FileResourceStream(new File(path + fileName));
getRequestCycle().scheduleRequestHandlerAfterCurrent(new
ResourceStreamRequestHandler(stream).setFileName(fileName));
.....
*with*
new DownloadLink("download", new File(path + fileName))
tnk
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309595.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Jan 19, 2012 at 10:33 AM, ricmancio <ri...@gmail.com> wrote:
> thanks for the suggestion, but now it works
That's good, no ?
Is there a question below ?
>
> also from the documentation:
>
> *https://cwiki.apache.org/WICKET/migration-to-wicket-15.html*
>
> *Redirect to non wicket or external page*
>
> suggests replacing old code :
> *
> getRequestCycle().setRequestTarget(new
> RedirectRequestTarget("/usage.html"));*
>
> with:
>
> *getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> RedirectRequestHandler("/usage.html"));*
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309548.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
Posted by ricmancio <ri...@gmail.com>.
thanks for the suggestion, but now it works
also from the documentation:
*https://cwiki.apache.org/WICKET/migration-to-wicket-15.html*
*Redirect to non wicket or external page*
suggests replacing old code :
*
getRequestCycle().setRequestTarget(new
RedirectRequestTarget("/usage.html"));*
with:
*getRequestCycle().scheduleRequestHandlerAfterCurrent(new
RedirectRequestHandler("/usage.html"));*
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309548.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Download Link doesn't work on 1.5.x
Posted by Martin Grigorov <mg...@apache.org>.
See the source code of DownloadLink
On Thu, Jan 19, 2012 at 10:06 AM, ricmancio <ri...@gmail.com> wrote:
> In Wicket 1.4.x I used
>
> Link link = new Link("download"){
>
> @Override
> public void onClick() {
>
> *IResourceStream stream = new FileResourceStream(new File(path +
> fileName));
> getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream)
> .setFileName(fileName));*
> }
> };
> *
> After migration on 1.5.x what code should I use?*
>
> I'm trying with:
>
> ....
> *getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> ResourceStreamRequestHandler(stream)
> .setFileName(fileName));*
>
> ...
> but doesn't work
>
> tnk
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Download-Link-doesn-t-work-on-1-5-x-tp4309507p4309507.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org