Re: T5: Can I redirect to another page in setupRender()?

2007-07-18 Thread dtrebbien
Thank you very much, Nick. This was what I was looking for. Nick Westgate wrote: > > Access validation should be done in onActivate(): > http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html > > Cheers, > Nick. > > > dtrebbien wrote: >> I have two pages: ListRepositories and

Re: T5: Can I redirect to another page in setupRender()?

2007-07-17 Thread Nick Westgate
Previous versions of Tapestry allowed redirection exceptions to be thrown precisely to avoid code like this. (Controversial, but better IMO.) Anyway, access validation shouldn't require a client side redirect. If you are working against the framework, there's probably a better way. Cheers, Nick.

Re: T5: Can I redirect to another page in setupRender()?

2007-07-17 Thread Donyee
I do this in the beforeRenderTemplate(),and works fine! boolean beforeRenderTemplate() throws IOException, ServletException { if (!isLogined()) { if (appState == null) { appState = new AppState(); }

Re: T5: Can I redirect to another page in setupRender()?

2007-07-17 Thread Nick Westgate
No, I'm pretty sure you can't. Read the documentation again, and look at: ComponentPageElementImpl.RenderPhaseEventHandler.handleResult() It seems to confirm that returning a component will render that component and then _continue_ with the rendering phases for the current component. Render pha

Re: T5: Can I redirect to another page in setupRender()?

2007-07-17 Thread Korben Zhang
Yes, you can. See T5 core components, such as 'If'. use Object setupRender() {...} See page http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html remember boolean is an object too. On 7/17/07, Nick Westgate <[EMAIL PROTECTED]> wrote: Access validation should be done in on

Re: T5: Can I redirect to another page in setupRender()?

2007-07-16 Thread Nick Westgate
Access validation should be done in onActivate(): http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html Cheers, Nick. dtrebbien wrote: I have two pages: ListRepositories and ViewRepository. ListRepositories is supposed to give ViewRepository an id number by calling ViewReposito

T5: Can I redirect to another page in setupRender()?

2007-07-16 Thread dtrebbien
I have two pages: ListRepositories and ViewRepository. ListRepositories is supposed to give ViewRepository an id number by calling ViewRepository's init() method. ViewRepository tracks whether it has been inited via a boolean value. The problem is, I want to redirect back to ListRepositories if a