Extend DynamicWebResource with something like

public class MyDynamicResource extends DynamicWebResource {    
    
    protected final ResourceState getResourceState() {
        return new MyResourceState();
    }    
   
    private class MyResourceState extends ResourceState {
        
        public String getContentType() {
            return "application/pdf";
        }
        
        public byte[] getData() {
            return pdfAsBayeArry;
        }

    }

}

and add a ResourceLink to your page, e.g.:

add(new ResourceLink("pdf-link", new MyDynamicResource()));



HTH, Kai


ulrik <mailto:[EMAIL PROTECTED]> wrote:
> Hi again
> 
> I have no idea of how to solve it..
> Could you please explain more in detail?
> 
> What I want to do is, when I click on a link/button or something
> similar I want to open a pdf which will be downloaded from a database
> as a byte[].. 
> 
> How would I do this?
> 
> //Ulrik
> 
> 
> Kai Mütz wrote:
>> 
>> ulrik <mailto:[EMAIL PROTECTED]> wrote:
>>> Hello!
>>> 
>>> I have a PDF file in a byte[]. How do I display that PDF in a new
>>> window when I click on a link? Can someone please point me in the
>>> right direction?
>> 
>> DynamicWebResource should do it.
>> 
>> 
> http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apac
> he/wicket/
>> markup/html/DynamicWebResource.html
>> 
>> Cheers,
>> Kai
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
http://www.nabble.com/Display-a-PDF-in-a-new-Window-tp19493773p19531929.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to