Re: Firing ajax request while returning a StreamResponse

2013-04-24 Thread George Christman
Ah yes, I didn't even give flash persist a thought, I think I'd rather use that to minimize url tampering. Thanks Lance. On Wed, Apr 24, 2013 at 1:53 PM, Lance Java wrote: > Something like this (not tested) > > @Inject > private ComponentResources resources; > > @Inject > private JavaScriptSuppo

Re: Firing ajax request while returning a StreamResponse

2013-04-24 Thread Lance Java
Something like this (not tested) @Inject private ComponentResources resources; @Inject private JavaScriptSupport jss; @Persist(PersistanceConstants.FLASH) private String pdfUrl; @SetupRender void setupRender() { if (pdfUrl != null) { jss.addScript("document.location.href = '%s';", pdfUrl); } }

Re: Firing ajax request while returning a StreamResponse

2013-04-24 Thread George Christman
Hi Lance, I think I'm with you most of the way with the exception of generating a link to the pdf event. So I'm returning PurchaseRequest.class in my onSuccess method which would for the page to reload with context from onPassivate, this should resolve my sync issues. Where I'm lost is how to trig

Re: Firing ajax request while returning a StreamResponse

2013-04-24 Thread Lance Java
Split it into 2 phases: Phase 1: Submit form Do the work (webservice + version increment) Generate a link to the generatePDF event Return the page to be re-rendered Phase 2: Re-render the page Use javascript to download the PDF once the page has loaded.

Firing ajax request while returning a StreamResponse

2013-04-24 Thread George Christman
So I'm facing a dilemma where my app uses hibernate version to prevent optimistic locking, but returns a PDF from a StreamResponse. When the user uses the submit action to generate a PDF, a few items are first saved to the database from a web service which causes the version to increment followed b