This is not possible without javascript because one request can only trigger one response.
I believe the most elegant and generic solution can be achieved through the concept of notifications (stackoverflow does this when it displays messages in the top ... and perhaps your app has something similar). So, anyway, imagine flash-persisted messages that your Layout component always outputs (if they exist) only that instead of being displayed directly, they trigger js functions (and in fact those "messages" would really be json). Those functions would then do the correct action in each case by: - either displaying some text in a fancy way - or opening a popup with the given url - or ... On Fri, Apr 8, 2011 at 14:46, Jim O'Callaghan <jc1000...@yahoo.co.uk> wrote: > Thanks for the suggestion Richard. One thing I am having difficulty with (I > couldn’t see this in your reply) is how to submit the form data required to > generate the PDF to the server before launching the PDF using target="blank". > Perhaps I am going about this in a wrong-headed way and need to rethink the > requirement. I’d welcome any other suggestions if anyone has one. I suppose > one approach could be to have a submit button that POSTs the form data, and > then redisplay the same page with the submit button hidden and a new > actionLink ‘View PDF’ now present but it seems a bit clunky. > > Regards, > Jim. > > From: Richard Hill [mailto:r...@su3analytics.com] > Sent: 08 April 2011 12:26 > To: Tapestry users > Subject: Re: Popup PDF > > > The simplest way I'm guessing is to have your link that > generates/returns the pdf to be a target="_blank" as you say. > > Then in javascript change the window url from the detail url to the > summary url. > > If adding your own js to an actionlink is tricky you could not use an > action (or page) link, but do the whole thing in javascript - open a new > window with the appropriate url for the pdf, and then load the summary > page in the current window. > > Or maybe a mixin would work if you want to add your own js to an action > or page link? > > > Richard. > > > > > On Fri, 2011-04-08 at 11:56 +0100, Jim O'Callaghan wrote: >> I have a requirement to generate a PDF based on some submitted form data in >> a 'detail' page, and then pop up the PDF in a new tab/window while at the >> same time returning from the 'detail' page to a 'summary' page. I don't >> want to pollute the summary page with any code related to opening the PDF in >> a new tab/window. The actual PDF is being generated and I can return that >> as a stream successfully but I'm trying to find out how to return the >> summary page in the existing tab/window, and also trigger the PDF opening in >> another tab/window, as effectively I'm trying to generate two server >> responses for one server request. Can anyone suggest a good way of going >> about this? Should I put something in the detail page that triggers an >> actionLink with target="_blank" before redirecting to the summary page? >> Thanks. >> >> Regards, >> Jim. >> >> >> --------------------------------------------------------------------- >> 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 > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3558 - Release Date: 04/07/11 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Apache Tapestry PMC / http://chesstu.be owner Open Source / JEE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org