Re: [t5.1] ajaxFormLoop disabled once page reloaded and returning a PDFStreamResponse

2011-12-09 Thread Jérémie Charlet
Thanks a lot for your answers! I am going to discuss with my colleagues
whether upgrade is possible. There is also a patch provided on the JIRA.
Otherwise I'll try your solutions and explain what solution we chose and
how I implemented it.
Regards,
Jérémie

Unfortunately upgrade is not possible, so I am going to try to use an
eventlink
On 9 December 2011 09:41, Joost Schouten (mailing lists) <
joost...@jsportal.com> wrote:

> Another option (if an upgrade is not possible) is to download your pdf to
> a hidden iframe. No new page opens and the zonemanager does not get
> unload'ed.
>
> On Dec 8, 2011, at 4:54 PM, antalk wrote:
>
> > I've 'fixed'  a similair issue by using an eventlink where the user can
> > download the document, but set the target attribute of the link to
> > target="_blank".
> >
> > The download page will open in a new window, but you dont have to refresh
> > the form.
> >
> > --
> > View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-1-ajaxFormLoop-disabled-once-page-reloaded-and-returning-a-PDFStreamResponse-tp5053108p5059217.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [t5.1] ajaxFormLoop disabled once page reloaded and returning a PDFStreamResponse

2011-12-08 Thread Jérémie Charlet
Does anyone have an idea on this? Is my presentation of the issue missing
clarity/details ?
Regards,
Jeremie

2011/12/6 Jérémie Charlet 

> Hello everyone,
>
> I am facing an issue while using ajaxFormLoop:
>
> On my page, I fill a form that includes among others a list of
> phoneNumbers to be set in an ajaxFormLoop. Once I submit the form, it
> generates a PDF (containing data from my form) and makes the user download
> it in his web browser. The user is not redirected to another page, the page
> is simply reloaded so that the user can fill once again the form and
> generate a new PDF.
>
> Problem is that once the page is reloaded (and my PDF file asked to be
> download), I cannot use the ajaxFormLoop anymore: if I click on addRow,
> nothing happens on the GUI. However if I reload manually the page, the
> ajaxFormLoop works back again and displays moreothers as many rows as I
> clicked previously on the addRow button. It seems that once I click on
> addRow, requests are indeed done server side, but the javaScript doesn't
> work anymore and and does not refresh the GUI and show the added rows.
>
> The problem might occur because in the function handling the submit event,
> I return a PDFStreamResponse instead of the tapestry page but I don't see
> how to solve it.. Return the PDFStreamResponse and somehow reload
> immediately after the page, but how? Is there a better way to make the user
> download the generated PDF?
>
>
> the ajaxFormLoop from the tml
>
>  t:source="phoneNumberList" t:encoder="phoneNumberRowEncoder">
>  
> 
>  
> 
>  
> 
> ${sharedcatalog:phoneNumber}
>  
>  t:validate="required" />
>  
> 
> 
>  
> 
> ${sharedcatalog:deletephoneNumber}
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  
> ${sharedcatalog:addphoneNumber}
> 
>  
> 
> 
>  
>
>
> the submit event handled in the java class
>
> @OnEvent(component = "myForm", value = EventConstants.SUBMIT)
>  public Object generatePDF() {
>
> InputStream pdfStream = null;
>  try {
> pdfStream = pdfGeneratorService.generateMandatePDF();
> } catch (PDFGeneratorServiceException e) {
>  e.printStackTrace();
> }
>
> // return the PDF as a PDFStreamResponse
>  return new PDFStreamResponse(pdfStream, "Addresses_" +
> System.currentTimeMillis() + ".pdf");
> }
>
>
> Thanks in advance for the help :),
> Jérémie
>


[t5.1] ajaxFormLoop disabled once page reloaded and returning a PDFStreamResponse

2011-12-06 Thread Jérémie Charlet
Hello everyone,

I am facing an issue while using ajaxFormLoop:

On my page, I fill a form that includes among others a list of phoneNumbers
to be set in an ajaxFormLoop. Once I submit the form, it generates a PDF
(containing data from my form) and makes the user download it in his web
browser. The user is not redirected to another page, the page is simply
reloaded so that the user can fill once again the form and generate a new
PDF.

Problem is that once the page is reloaded (and my PDF file asked to be
download), I cannot use the ajaxFormLoop anymore: if I click on addRow,
nothing happens on the GUI. However if I reload manually the page, the
ajaxFormLoop works back again and displays moreothers as many rows as I
clicked previously on the addRow button. It seems that once I click on
addRow, requests are indeed done server side, but the javaScript doesn't
work anymore and and does not refresh the GUI and show the added rows.

The problem might occur because in the function handling the submit event,
I return a PDFStreamResponse instead of the tapestry page but I don't see
how to solve it.. Return the PDFStreamResponse and somehow reload
immediately after the page, but how? Is there a better way to make the user
download the generated PDF?


the ajaxFormLoop from the tml


 

 

 

${sharedcatalog:phoneNumber}
 

 


 

${sharedcatalog:deletephoneNumber}
 


 


 


 
${sharedcatalog:addphoneNumber}

 


 


the submit event handled in the java class

@OnEvent(component = "myForm", value = EventConstants.SUBMIT)
 public Object generatePDF() {

InputStream pdfStream = null;
 try {
pdfStream = pdfGeneratorService.generateMandatePDF();
} catch (PDFGeneratorServiceException e) {
 e.printStackTrace();
}

// return the PDF as a PDFStreamResponse
 return new PDFStreamResponse(pdfStream, "Addresses_" +
System.currentTimeMillis() + ".pdf");
}


Thanks in advance for the help :),
Jérémie