> Gleaned from the Vlib demo:
>
> What you can do is use cycle.getPage("error page name"), cast it to your
> error page class, and then invoke a method on it to set the error code,
> before calling cycle.setPage(error page object).
>

You could also pass a page name to the ErrorPage, so the user could click a
button to continue.

For convenience , one might extend SimpleEngine and add  goErrorMethods like
this:

// pass control to the error page, setting its code and making its continue
page the current page
public void goError(int code, IRequestCycle cycle) throws
RequestCycleException {

    goError(code, cycle.getPage().getName(), cycle);

}

// pass control to the error page, setting its code and  its continue page
public void goError(int code, String continuePage, IRequestCycle cycle)
throws RequestCycleException {

  ErrorPage epage = (ErrorPage)cycle.getPage("Error");
  epage.setCode(code);
  epage.setContinuePage(continuePage);
  cycle.setPage(epage);

}





-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to