You are using 5.0.5? I believe 5.0.6 has a fix for this, wherein the method invocation order is by number of parameters, decreasing.
You may have to do: Object onActivate(Object[] context) { ... } And check the context count explicitly, and convert the context values explicitly, if you are on 5.0.5. On Nov 24, 2007 11:37 AM, Andy Huhn <[EMAIL PROTECTED]> wrote: > Hello, > > I'm having a problem with onActivate(). Here are my questions: > 1) Why is onActivate() called when a context variable is included in the > URL? > 2) Is there a way to prevent onActivate() from being called until AFTER > onActivate(Integer prmPrimaryKey) is called? > > Here's my dilemma: I want to use one detail page to handle inserts and > updates. So I have written an onActivate(Integer prmPrimaryKey) handler > to initialize the page for an update; and another onActivate() handler > to initialize the page for an insert. > > Each onActivate() handler checks to see if the user is allowed to access > this page. If the user is not allowed to access, the onActivate() > handler generates a Link with the current page's context, uses that Link > to set a Session state variable, and then returns a Login page. Once > the user logs in, the Session state variable is checked to see if it has > been set; if so, the user is taken back to that page. > > My problem is that when the page is accessed with a context variable > (thus, to handle an UPDATE), onActivate() is being called before > onActivate(Integer prmPrimaryKey). Thus, the entity ID of the page > isn't being set before the Link is generated and added to the session > state. > > The Link that is being generated, then, doesn't have any context > included, so when the user finishes logging in, the user is taken back > to the page, with no context. > > Is this a Tapestry bug, or is there a better way of handling this? > > Thanks, > Andy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]