You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "David Peterson (JIRA)" <de...@tapestry.apache.org> on 2007/06/26 00:09:26 UTC

[jira] Created: (TAPESTRY-1601) The no-params onActivate() method is called even if a context is supplied

The no-params onActivate() method is called even if a context is supplied
-------------------------------------------------------------------------

                 Key: TAPESTRY-1601
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1601
             Project: Tapestry
          Issue Type: Bug
    Affects Versions: 5.0.4, 5.0.3, 5.0.5
            Reporter: David Peterson


What I'm trying to do is redirect to another page, if my page has not been given any context.

Something like this:

    Object onActivate(String context) {
         if (context == null) {
              return _otherPage;
         }
         return null;
    }

Unfortunately that method does not get run if the context is missing.

I tried:

    Object onActivate() {
          return _otherPage;
    }

But this method is run even if there is a context. And it's run before the other one, so I can't even set a flag. I've tried returning the page from setupRender() instead, but that expects a boolean result and doesn't work. So, what do I do?


Suggested fixes (in order of preference):
- Allow a page to be returned from setupRender()
- Do not call onActivate() if onActivate(context) has already been called
- Provide another event after all the onActivate() methods have been called


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Resolved: (TAPESTRY-1601) The no-params onActivate() method is called even if a context is supplied

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship resolved TAPESTRY-1601.
--------------------------------------------

    Resolution: Invalid
      Assignee: Howard M. Lewis Ship

This is by design.

Events are no invoked in descending order by number of parameters.  This should help you determine the intent.

> The no-params onActivate() method is called even if a context is supplied
> -------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1601
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1601
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0.3, 5.0.4, 5.0.5
>            Reporter: David Peterson
>            Assignee: Howard M. Lewis Ship
>
> What I'm trying to do is redirect to another page, if my page has not been given any context.
> Something like this:
>     Object onActivate(String context) {
>          if (context == null) {
>               return _otherPage;
>          }
>          return null;
>     }
> Unfortunately that method does not get run if the context is missing.
> I tried:
>     Object onActivate() {
>           return _otherPage;
>     }
> But this method is run even if there is a context. And it's run before the other one, so I can't even set a flag. I've tried returning the page from setupRender() instead, but that expects a boolean result and doesn't work. So, what do I do?
> Suggested fixes (in order of preference):
> - Allow a page to be returned from setupRender()
> - Do not call onActivate() if onActivate(context) has already been called
> - Provide another event after all the onActivate() methods have been called

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org