Hi Malcolm, On Mon, May 16, 2011 at 4:32 PM, Malcolm Edgar <[email protected]>wrote:
> Hi Anne, > > This is more of a JavaScript HTML question than a Velocity templating > engine. If you google search you will find your answer pretty quickly. > > http://www.w3schools.com/jsref/met_win_open.asp > http://www.javascript-coder.com/window-popup/javascript-window-open.phtml > > Anyway what you are after is using the JavaScript window.open > function. To open a window after you render a page you will need to > have a JavaScript function call the window.open function when the page > loads. Please note browsers may prevent this from working, via their > popup blockers so your results may be mixed. > Thanks Malcolm. I will try with them and will ask here if I've got any questions related to Velocity templates. Thanks, Anne > > regards Malcolm Edgar > > On Mon, May 16, 2011 at 8:00 PM, Anne Peter <[email protected]> wrote: > > Hi Tim, > > > > On Mon, May 16, 2011 at 2:23 PM, Tim Pizey <[email protected]> wrote: > > > >> On 16 May 2011 09:14, Anne Peter wrote: > >> > Hi, > >> > > >> > I am very new to Velocity and I tried with few samples by writing > >> Servlets > >> > extending VelocityViewServlet and implementing the handleRequest(). > This > >> > method displays the output in a new page. > >> > > >> > But my requirement is: > >> > When a button on a JSP is clicked, the template should get processed & > >> > merged and the output of the template should be shown in a popup > window. > >> > (i.e: the parent window should display the same content as earlier & > the > >> > form should be shown in a popup). > >> > > >> > I would like to know how can I achieve this. > >> > >> Make your velocity servlet produce the content of the popup. > >> > >> In your calling page: > >> > >> <a href="myPopupservlet" target="_new"> > >> > >> > >> > > This works; but opens the content of the form in a new tab/window. > > What I actually want is a javascript pop up that shows in-front of the > > browser, showing the content (for which I can set the pop up window > > width,height etc). > > I think the *href *resource should be to a javascript function which > calls > > the velocity servlet. Is it possible to call the velocity servlet inside > a > > javascript function and show the contents in a pop up? > > > > > > Thanks, > > Anne > > > > > > > >> > >> > >> -- > >> Tim Pizey > >> http://pizey.net/~timp > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
