You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Net Dawg <ne...@yahoo.com.INVALID> on 2014/07/07 06:10:06 UTC

Page Method for Stream Response to Pagelink

I am trying to stream PDF in response to a pagelink, NOT submit button as in:
http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile

In the above wiki, the method used is "onSubmit"...what would be the corresponding method for pagelink.  


// what method should be used instead of onSubmit to capture pagelink request to this page?

public StreamResponse onSubmit() 
{
  // Create PDF
  InputStream is = PDFGenerator.generatePDF("This is the content of a Dynamically Generated PDF");
  // Return response
  return new PDFStreamResponse(is,"MyDynamicSample");
}



I already tried onAction, onPassivate, etc as per these references: 


http://tapestry.apache.org/page-navigation.html#PageNavigation-Pageactivation
(Pattern 3: Render Requests Only)
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen
(render request)

Re: Page Method for Stream Response to Pagelink

Posted by Geoff Callender <ge...@gmail.com>.
I'm glad you found that example. 

Here's a different one that solves it with PageLink. The page it links to is PersonFind, which returns a StreamResponse:

	http://jumpstart.doublenegative.com.au/jumpstart7/examples/ws/webservices

Cheers,

Geoff


On 7 Jul 2014, at 2:54 pm, Net Dawg <ne...@yahoo.com.INVALID> wrote:

> Solved: 
> 
> 
> basically, replaced pagelink by eventlink using StreamResponse Return Type per below
> http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/returntypes1
> 
> 
> 
> On Sunday, July 6, 2014 6:13 PM, Net Dawg <ne...@yahoo.com.INVALID> wrote:
> 
> 
> 
> I am trying to stream PDF in response to a pagelink, NOT submit button as in:
> http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile
> 
> In the above wiki, the method used is "onSubmit"...what would be the corresponding method for pagelink.  
> 
> 
> // what method should be used instead of onSubmit to capture pagelink request to this page?
> 
> public StreamResponse onSubmit() 
> {
>   // Create PDF
>   InputStream is = PDFGenerator.generatePDF("This is the content of a Dynamically Generated PDF");
>   // Return response
>   return new PDFStreamResponse(is,"MyDynamicSample");
> }
> 
> 
> 
> I already tried onAction, onPassivate, etc as per these references: 
> 
> 
> http://tapestry.apache.org/page-navigation.html#PageNavigation-Pageactivation
> (Pattern 3: Render Requests Only)
> http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen
> (render request)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Page Method for Stream Response to Pagelink

Posted by Net Dawg <ne...@yahoo.com.INVALID>.
Solved: 


basically, replaced pagelink by eventlink using StreamResponse Return Type per below
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/returntypes1



On Sunday, July 6, 2014 6:13 PM, Net Dawg <ne...@yahoo.com.INVALID> wrote:
 


I am trying to stream PDF in response to a pagelink, NOT submit button as in:
http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile

In the above wiki, the method used is "onSubmit"...what would be the corresponding method for pagelink.  


// what method should be used instead of onSubmit to capture pagelink request to this page?

public StreamResponse onSubmit() 
{
  // Create PDF
  InputStream is = PDFGenerator.generatePDF("This is the content of a Dynamically Generated PDF");
  // Return response
  return new PDFStreamResponse(is,"MyDynamicSample");
}



I already tried onAction, onPassivate, etc as per these references: 


http://tapestry.apache.org/page-navigation.html#PageNavigation-Pageactivation
(Pattern 3: Render Requests Only)
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen
(render request)

Re: Page Method for Stream Response to Pagelink

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 07 Jul 2014 01:10:06 -0300, Net Dawg <ne...@yahoo.com.invalid>  
wrote:

> I already tried onAction, onPassivate, etc as per these references:

It's onActivate():

Object onActivate(...) {
	...
	return streamResponse;
}

> http://tapestry.apache.org/page-navigation.html#PageNavigation-Pageactivation
> (Pattern 3: Render Requests Only)

In that exact page, see section 7. Stream response.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org