I know that onActivate can have EventContext argument, but it's less
explicit compared to some specific onActivate for given page, such as
public void onActivate(Long id) {...}
and I don't want every page to have :
public void onActivate(EventContext ec) {...}
just because I want each of those pages to be accessed in a generic way from
LoginPage when user logs in.
What I need is some generic way of collectiing activation context values
from some page instance (eg. triggering "passivate" event on page instance
and collecting return values), and also applying that same activation
context on desired page instance also in generic fashion (triggering
"activate" event with that argument).
I cannot do any of this via spoecific hardcoded way, since maybe some of my
page has activation context specified via @PageActivationContext so I don't
have an option to call manually onActivate or onPassivate, I have to di it
the same way as Tapestry is doing it internally when it manages activation
context.
-Vjeran
----- Original Message -----
From: "Felix Gonschorek" <fe...@ggmedia.net>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Sunday, August 09, 2009 1:48 PM
Subject: Re: [T5] Log in directly to requested page (not just home page)
Hi,
there are two hints that may help you:
You have two additional options for the parameters of you onActivate()
method:
a) One parameter of type Object[]
b) One parameter of type EventContext
(http://tapestry.apache.org/tapestry5/apidocs//org/apache/tapestry5/EventContext.html)
i use b) very often
felix
Vjeran Marcinko schrieb:
Hello,
Is there any way to genericaly extract activation context (array or
EventContext) from some page instance?
I'm asking this because I want my page authorization to work in a way to
remember what page and activation context has been requested by
unauthorized user, so that after he logs in successfuly, I would
redirect him to that requested page. For that to work, inside my
SecuredPage superclass, I have to be able to extract requested page name
(which is easy) and also activation context (which I don't know how), so
I would be able to store them inside LogIn page form for later access in
case of successful login.
BTW, is there also some generic way to apply activation context on page
instance without calling onActivate insid ecode, because I would
probably have something like:
public void onActivate(Long id) {...}
whereas I have activation in a array form?
Or some other suggestion for implementing this feature maybe? I guess
this functionality would also be useful for implementing some generic
breadcrumbs component....
Regards,
Vjeran
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.48/2292 - Release Date: 08/09/09
08:08:00
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org