You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marios Skounakis <ms...@gmail.com> on 2012/12/12 10:51:16 UTC

What is the wicket 6 equivalent of ComponentRequestTarget?

Hi all,

I found this old code:

getRequestCycle().setRequestTarget(new ComponentRequestTarget(dataTable));
WebResponse wr = (WebResponse) getResponse();
wr.setContentType("application/vnd.ms-excel; charset=UTF-8");
wr.setCharacterEncoding("UTF-8");
wr.setHeader("content-disposition", "attachment;filename=excel.xls");

I understand all the drawbacks of getting the HTML from a data table and
disguise it as an excel file, but I have a similar use case that I want do
get and return the markup of a single component.

The above code contains classes and methods that have been removed. Can
someone please provide the wicket 6 equivalent of the above?

Thanks
Marios

Re: What is the wicket 6 equivalent of ComponentRequestTarget?

Posted by Marios Skounakis <ms...@gmail.com>.
Thanks for the prompt reply Martin. I'm not migrating, I just found this
code on the net and wanted to use it. Point taken though, I should look in
the migration notes first...


On Wed, Dec 12, 2012 at 12:00 PM, Martin Grigorov <mg...@apache.org>wrote:

> cycle.scheduleRequestHandlerAfterCurrent(new ComponentRenderingRequestHandl
> er(...))
>
> This API has changed with Wicket 1.5. You may want to read its migration
> page since you migrate from older version directly to Wicket 6
>
>
> On Wed, Dec 12, 2012 at 10:51 AM, Marios Skounakis <ms...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > I found this old code:
> >
> > getRequestCycle().setRequestTarget(new
> ComponentRequestTarget(dataTable));
> > WebResponse wr = (WebResponse) getResponse();
> > wr.setContentType("application/vnd.ms-excel; charset=UTF-8");
> > wr.setCharacterEncoding("UTF-8");
> > wr.setHeader("content-disposition", "attachment;filename=excel.xls");
> >
> > I understand all the drawbacks of getting the HTML from a data table and
> > disguise it as an excel file, but I have a similar use case that I want
> do
> > get and return the markup of a single component.
> >
> > The above code contains classes and methods that have been removed. Can
> > someone please provide the wicket 6 equivalent of the above?
> >
> > Thanks
> > Marios
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: What is the wicket 6 equivalent of ComponentRequestTarget?

Posted by Martin Grigorov <mg...@apache.org>.
cycle.scheduleRequestHandlerAfterCurrent(new ComponentRenderingRequestHandl
er(...))

This API has changed with Wicket 1.5. You may want to read its migration
page since you migrate from older version directly to Wicket 6


On Wed, Dec 12, 2012 at 10:51 AM, Marios Skounakis <ms...@gmail.com> wrote:

> Hi all,
>
> I found this old code:
>
> getRequestCycle().setRequestTarget(new ComponentRequestTarget(dataTable));
> WebResponse wr = (WebResponse) getResponse();
> wr.setContentType("application/vnd.ms-excel; charset=UTF-8");
> wr.setCharacterEncoding("UTF-8");
> wr.setHeader("content-disposition", "attachment;filename=excel.xls");
>
> I understand all the drawbacks of getting the HTML from a data table and
> disguise it as an excel file, but I have a similar use case that I want do
> get and return the markup of a single component.
>
> The above code contains classes and methods that have been removed. Can
> someone please provide the wicket 6 equivalent of the above?
>
> Thanks
> Marios
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>