Re: T5: redirecting page under onActivate

2007-09-19 Thread Josh Canfield
Another option for remembering where you have come from is to tell the page explicitly. In Member have @Persist private Link _lastPageLink; In Home/Other have @InjectPage private Member _memberPage; You can use an action link handler to go to the page protected Link getGotoMemberLink() { Object

Re: T5: redirecting page under onActivate

2007-09-19 Thread Marcus
Angelo, Sorry, return false (or true) is not an option, you must known the page name. Returning null allow access. Marcus

Re: T5: redirecting page under onActivate

2007-09-19 Thread Marcelo Lotif
Angelo, On a pretty creepy workaround, you can have, on the Member page, an String attribute named caller that you can set with the "Other" or "Main" values(depending on who called it) and you can return it on the Member's onActivate method... 2007/9/19, Angelo Chen <[EMAIL PROTECTED]>: > > > Tha

Re: T5: redirecting page under onActivate

2007-09-19 Thread Angelo Chen
Thanks. Marcus-11 wrote: > > Hi Angelo, > > Maybe this hel with your first question: > > -- View this message in context: http://www.nabble.com/T5%3A-redirecting-page-under-onActivate-tf4479292.html#a12775141 Sent from the Tapestry - User mailing list archive at Nabble.com. -

Re: T5: redirecting page under onActivate

2007-09-19 Thread Angelo Chen
Hi Nick, I think so, one way to persist caller is, adding a t:id, here is what I do: < a t:type="pagelink" page="Member" context="rowBltn.id" t:id="Home">${RowBltn.name} a> the rendered page will have something like this: /myapp/member/6 Now, is there a way to access this id in the onActivat

Re: T5: redirecting page under onActivate

2007-09-19 Thread Marcus
Hi Angelo, Maybe this hel with your first question: public class ProtectedPage { @ApplicationState private Visit _visit; public Visit getVisit() { return _visit; } public void setVisit(Visit _visit) { this._visit = _visit; } public Object onActivate() { if (!_vis

Re: T5: redirecting page under onActivate

2007-09-19 Thread Nick Westgate
I suspected you meant this. You'll have to persist the "caller" somehow. If you're using a base page class you could store it in an ASO there. Cheers, Nick. Angelo Chen wrote: Hi Marcus, Example: both Home.html and Other.html has a link to Member, when the link is clicked, Member.class' onAct

Re: T5: redirecting page under onActivate

2007-09-19 Thread Angelo Chen
Hi Marcus, Example: both Home.html and Other.html has a link to Member, when the link is clicked, Member.class' onActivate will be called, if I return null, it displays Member.html, but I'd like to display Home or Other if there is validation error, possible? If not possible, is there a way to p

Re: T5: redirecting page under onActivate

2007-09-19 Thread Marcus Schmidke
Just return null. On 9/19/07, Angelo Chen <[EMAIL PROTECTED]> wrote: > > Hi Josh, > > Thanks, it works, a related question, how to redirect the page to the one > calling? sometimes we don't know which one is "calling page", so we can't > use page class/name to redirect, any idea? Thanks. > A.C. >

Re: T5: redirecting page under onActivate

2007-09-19 Thread Angelo Chen
Hi Josh, Thanks, it works, a related question, how to redirect the page to the one calling? sometimes we don't know which one is "calling page", so we can't use page class/name to redirect, any idea? Thanks. A.C. Josh Canfield-2 wrote: > > You can return an object that represents the page you

Re: T5: redirecting page under onActivate

2007-09-19 Thread Josh Canfield
You can return an object that represents the page you want to redirect to. The allowed objects are described here: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html Josh On 9/19/07, Angelo Chen <[EMAIL PROTECTED]> wrote: > > > Hi, > > Is there a way to redirect the page under

T5: redirecting page under onActivate

2007-09-19 Thread Angelo Chen
Hi, Is there a way to redirect the page under onActivate? example: there might be a logical error detected and program will direct user to another page instead of the original one, possible? Thanks. A.C. -- View this message in context: http://www.nabble.com/T5%3A-redirecting-page-under-onActiv