Great minds think alike! I'm just typing in the <form /> statement as you sent your email!
Kimbo. -----Original Message----- From: Yurii Urazlin [mailto:[EMAIL PROTECTED] Sent: 20 June 2003 09:21 To: [EMAIL PROTECTED] Subject: RE: [Mav-user] Another newbie question (sort of) forking a model to two pages [Scanned] Hi there, as far as I understood, u could open window with PDF in a different way. U could just specify <form target="_blank" ...> in your 'controller' window instead of opening PDF with javascript. This way all parameters specified in 'controller' window will be sent to a new window with PDF. Cheers, yurazlin. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kimberley > Scott > Sent: Friday, June 20, 2003 11:07 AM > To: Mav-User (E-mail) > Subject: [Mav-user] Another newbie question (sort of) forking a model to two > pages > > Hiya, > > First of all, thanks to those who responded on my last silly question. Yet another > newbie probably really easy question. Sorry. This may be a fraction off-topic as > it's not strictly a maverick question per se, but any answers could help others in > the same boat. > > I have a page with a structure like this: > > Wrapper start > Prologue > Form > Submit > Epilogue > Wrapper End > > The wrapper 'wraps' the central prologue-epilogue which is simply a jsp view. The > user fills in the form and submits. The page is then recalled, but during the > wrapper start, a configurable piece of javascript (via <c:set/> in the prologue) is > used to start a new window (via window.open()) to create a new page that would also > get the model and proceed to use Lowagies pdf library to create a pdf based on the > same model that is used in the page. Thus the page above is simply a 'controller' to > allow the user to choose options which the model then uses to calculate resultant > values which are exposing in a pdf output file in a seperate window. The > window.open() uses 'http.../pdf.m' as it's url, so a <command/> is called which uses > the same controller class as the page above. The /pdf is a servlet rather than a jsp > btw. The whole thing is sort of like a fork-and-exec process. > > The pdf servlet can access the model and maverick context via the > request.getAttribute() methods. But the model is (not surprisingly) empty. The > wrapper code in the 'view' page *could* push the incoming model into a session > variable I suppose, and the servlet retrieve it, stuff it into the request, then > call the context go(), then the models perform() method, but the choice of stuffing > things into the session feels a tad clunky and makes it 100% dependent on a session. > I could also have the wrapper-start javascript code have a querystring pasted on > which has all the models name-values and do the same go() - perform() process, but > that also seems clunky especially since this is a financial application and the > model has a lot of 'bits' to it which would be a tad ugly in a querystring. > > I have to point out that the issue is cloning a model and getting that model into a > new request, not the processing of it via go() and perform() within the servlet. > > So my question is: can anybody think of an elegant way to pass a model-as-controller > to a new window with cloned values? Or even a more elegant way to perform the whole > process? > > Ta muchly > Kimbo > > Ms Kimberley Scott > Senior Software Engineer > DCG Media Ltd ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php [INVALID FOOTER] ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php [INVALID FOOTER]