Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-23 Thread Mats Norén
We solved it with a resource and passed an interface IDataSource to the resource in the constructor and on getResourceState we made a call for the datasource. It feels like better solution. Thanks for the input. On 3/22/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > Yeah. Having many options is

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Eelco Hillenius
Yeah. Having many options is not always a good thing. Please note that request targets are not specifically meant for day-to-day end user usage. They are meant to more clearly define the request processing, and to have extensibility form a framework's perspective, e.g. to implement new things like

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Mats Norén
Even better. Thanks for the tip. There are so many options it's quite easy to get confused :) Mats On 3/22/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > You don't need a PageRequestTarget as the page doesn't add any value > here. I would use ResourceStreamRequestTarget and provide your content

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Eelco Hillenius
You don't need a PageRequestTarget as the page doesn't add any value here. I would use ResourceStreamRequestTarget and provide your content wrapped in a IResourceStream. Eelco On 3/22/06, Mats Norén <[EMAIL PROTECTED]> wrote: > On 3/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > why not just

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Mats Norén
Ok, thanks! On 3/22/06, Johan Compagner <[EMAIL PROTECTED]> wrote: > just create ResourceLink with a DynamicByteArrayResource > And implement getResourceState() and when that is called you do youre > loading. > > > johan > > > On 3/22/06, Mats Norén <[EMAIL PROTECTED]> wrote: > > Sorry, I'm not qu

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Johan Compagner
just create ResourceLink with a DynamicByteArrayResourceAnd implement getResourceState() and when that is called you do youre loading.johanOn 3/22/06, Mats Norén <[EMAIL PROTECTED]> wrote: Sorry, I'm not quite with you.How is the DynamicByteArrayResource called from the internals?On 3/22/06, Johan

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Mats Norén
Sorry, I'm not quite with you. How is the DynamicByteArrayResource called from the internals? On 3/22/06, Johan Compagner <[EMAIL PROTECTED]> wrote: > See DynamiceByteArrayResource > Then you can do the load lazy. Only when the link is clicked. > > johan > > > > On 3/22/06, Mats Norén < [EMAIL PRO

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Johan Compagner
See DynamiceByteArrayResourceThen you can do the load lazy. Only when the link is clicked.johanOn 3/22/06, Mats Norén < [EMAIL PROTECTED]> wrote:On 3/22/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:> That's not the preferred way of working though. If you want to play> nice with the framework, you

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Mats Norén
On 3/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > why not just push a download request target into the request cycle? it works > for 1.2. search this list for "excel" So if I were to use the request target approach I would do: protected void onSubmit() { getRequestCycle().setRequestTarg

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-22 Thread Mats Norén
On 3/22/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > That's not the preferred way of working though. If you want to play > nice with the framework, you should either make it a resource - imo > the most elegant solution, and again, look at > wicket-contrib-jasperreports - or a custom request tar

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Eelco Hillenius
Yeah, it made sense that that's what you did in 1.1, as we didn't have request targets yet :) On 3/21/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > That's not the preferred way of working though. If you want to play > nice with the framework, you should either make it a resource - imo > the mos

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Eelco Hillenius
That's not the preferred way of working though. If you want to play nice with the framework, you should either make it a resource - imo the most elegant solution, and again, look at wicket-contrib-jasperreports - or a custom request target. By using WebResponse directly like that, you are circumven

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Mats Norén
On 3/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > why not just push a download request target into the request cycle? it works > for 1.2. search this list for "excel" Hmmm. I looked at the examples in the thread but I don't see how I can get the outputstream and use POI:s method write(outputs

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Timo Stamm
Mats Norén schrieb: I'm trying to export a POI worksheet as a download link in my wicket page. The link sets the responsepage to a download page in which trying to get the outputbuffer to write to. You can do that directly from your link, without an intermediate page. At least it works with b

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Igor Vaynberg
why not just push a download request target into the request cycle? it works for 1.2. search this list for "excel"-IgorOn 3/21/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: That has to do with the page render strategy. A way around this is tochange that strategy, but a much better solution is to

Re: [Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Eelco Hillenius
That has to do with the page render strategy. A way around this is to change that strategy, but a much better solution is to make your PO worksheet a resource instead of a page. Please check out wicket-stuff's JasperReports integration for an idea how to do this. Eelco On 3/21/06, Mats Norén <[EM

[Wicket-user] Writing to outputstream (Trying to do export)

2006-03-21 Thread Mats Norén
Hi, I'm trying to export a POI worksheet as a download link in my wicket page. The link sets the responsepage to a download page in which trying to get the outputbuffer to write to. Only problem is that I keep getting this: "java.lang.UnsupportedOperationException: Cannot get output stream on Buffe