Maybe try this?

http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/services/ComponentEventLinkEncoder.html#decodeComponentEventRequest(org.apache.tapestry5.services.Request)


On Fri, May 16, 2014 at 10:01 PM, Robert Hailey <rhai...@allogy.com> wrote:

>
> Greetings,
>
> I've run into a case where I must be able to tell if the current request
> is a page-render request, or component-event request from within an
> onActivate() function.
>
> Is there a common/easy/concise way to do this?
>
> Something like:
>
> public
> class MyPage
> {
>         @Inject
>         private Request request;
>
>         void onActivate()
>         {
>                 prequel();
>
>                 //NB: none of these work :)
>                 if (request instanceof PageRenderRequest)
>                 {
>                         doSomething();
>                 }
>
>                 //NB: or maybe...
>                 if (request.isComponentEventRequest())
>                 {
>                         doSomethingElse();
>                 }
>
>                 sequel();
>         }
> }
>
> It would be a lot of work to reorganize the code around the setupRender()
> function, so I'd much rather a simple test.
>
> Does anyone know how this can be done?
>
> --
> Robert Hailey
>
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Reply via email to