It might be worth noting that this example will only work in tapestry
4. To perform the same thing in 3, you can get rid of the abstract
IPage property and @InjectPage annotation, and change the listener
method to something like this:
public void cancel(IRequestCycle cycle)
{
//do stuff
IPage page = (Details)cycle.getPage("CloseBrowserWindow");
cycle.activate(page);
}
On 8/18/05, Paul Cantrell <[EMAIL PROTECTED]> wrote:
> BEWARE: untested code!
>
> @InjectPage( value="CloseBrowserWindow" )
> public abstract IPage getCloseBrowserWindowPage();
>
> public IPage cancel() {
> // do stuff
> return getCloseBrowserWindowPage();
> }
>
> CloseBrowserWindow.html:
>
> <html>
> <head>
> <script type="text/javascript">
> window.close();
> </script>
> </head>
> </html>
>
> Not sure if that's exactly right, but hopefully it will help you
> figure it out.
>
> Cheers,
>
> Paul
>
>
> On Aug 18, 2005, at 11:16 AM, Patrick Yip wrote:
>
> > Can you provide a simple example?
> > Thanks.
> >
> > -----Original Message-----
> > From: Paul Cantrell [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, August 18, 2005 10:01 AM
> > To: Tapestry users
> > Subject: Re: How to close the brower Inside a Listener? (TP 3.0.3)
> >
> > You could try having the listener redirect to a IPage that contains
> > Javascript to close the browser window.
> >
> > On Aug 18, 2005, at 10:43 AM, Patrick Yip wrote:
> >
> >
> >> I have a simple form that have 2 submits that tied to 2 listeners.
> >> One submit is to Save and the other is to Cancel.
> >>
> >> Is it possible to programmatically close the browser inside the
> >> Cancel
> >> listener?
> >>
> >
> > _________________________________________________________________
> >
> > "Prediction is hard, especially of the future." -- Niels Bohr
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> _________________________________________________________________
>
> "I never let my schooling get in the way of my education."
> -- Mark Twain
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]