Re: Calling a specific page + Event

Richard Kirby <[email protected]>
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
Lennart Benoot wrote:

>
>
> 2) What is the best way to do the following: I have a certain error 
> page that i want to show when an error occurs at a certain part in the 
> code. I use the the cycle.setPage( ...) to go to the error page. The 
> error page contains a dynamic field with an error code. This code 
> should be filled in somewhere before the cycle.setPage(...) so that 
> the error page can retrieve the code and show it to the user. A 
> possible solution could be adding an errorCode field in the visit 
> object and then make the error page query for the value in the visit 
> object. This solution is probably not the best one. What is the best 
> way to do this?


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).

Richard.




-------------------------------------------------------
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.