Re: Page expired upon file download + model update
On Thu, 11 Oct 2007 17:00:46 +0200 Federico Fanton [EMAIL PROTECTED] wrote: The button has setDefaultFormProcessing(false), and overrides onSubmit so that the form model object is sent to the persistence layer and printed immediately afterwards. The persistence layer *may* alter the object, so I have to reload it. My problem is that this reloading causes a page expired when I press the button for a second time. Ouch! Looks like it was simply a serialization issue.. ^^; Is there a way to trigger blocking Serialization exceptions instead of simply logging them? Many thanks :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page expired upon file download + model update
On Mon, 15 Oct 2007 09:37:50 +0200 Federico Fanton [EMAIL PROTECTED] wrote: See here http://cwiki.apache.org/WICKET/best-practices-and-gotchas.html#BestPracticesandGotchas-Startingdownloadafterformsubmission(Wicket1.1) Sorry, I forgot to say I'm using 1.3-beta3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page expired upon file download + model update
See here http://cwiki.apache.org/WICKET/best-practices-and-gotchas.html#BestPracticesandGotchas-Startingdownloadafterformsubmission(Wicket1.1) Federico Fanton wrote: Hi everyone! I have a form with some fields and a submit button which says Save and print. The button has setDefaultFormProcessing(false), and overrides onSubmit so that the form model object is sent to the persistence layer and printed immediately afterwards. The persistence layer *may* alter the object, so I have to reload it. My problem is that this reloading causes a page expired when I press the button for a second time. My onSubmit: if(getForm().process()){ MyBean data=getForm().getModelObject(); data=Persistence.save(data); // Create PDF and send it to the browser IResourceStream s = new ByteArrayResource(application/pdf, buildPDF(data)).getResourceStream(); RequestCycle.get().setRequestTarget( new ResourceStreamRequestTarget(s) ); getForm().setModelObject(data); } I think the page expires because sending the PDF to the browser blocks the request cycle, so the browser never renders the new version of the page.. Is there a way to do this? Am I doing Something Wrong? ^__^; Many thanks for your time! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Klochkov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Page expired upon file download + model update
Hi everyone! I have a form with some fields and a submit button which says Save and print. The button has setDefaultFormProcessing(false), and overrides onSubmit so that the form model object is sent to the persistence layer and printed immediately afterwards. The persistence layer *may* alter the object, so I have to reload it. My problem is that this reloading causes a page expired when I press the button for a second time. My onSubmit: if(getForm().process()){ MyBean data=getForm().getModelObject(); data=Persistence.save(data); // Create PDF and send it to the browser IResourceStream s = new ByteArrayResource(application/pdf, buildPDF(data)).getResourceStream(); RequestCycle.get().setRequestTarget( new ResourceStreamRequestTarget(s) ); getForm().setModelObject(data); } I think the page expires because sending the PDF to the browser blocks the request cycle, so the browser never renders the new version of the page.. Is there a way to do this? Am I doing Something Wrong? ^__^; Many thanks for your time! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]