You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jack Nuzbit <fn...@googlemail.com> on 2010/09/17 17:58:52 UTC

T5.1: componentSource with an activation context

Hi,

Is there a way to create Pages and initialise their activation context at a
service level?

ComponentSource can give me Component instances but casting it to my page
instance results in a ClassCastException due to the different classloaders.
Is there a way I can set an activation/event context in this component using
existing Tapestry services?

This thread does mention that I could use an interface defined outside of
the component/page/mixin packages but it feels like there might be a way to
hook into the existing tapestry context behaviour...

http://tapestry.1045711.n5.nabble.com/Tap-5-0-11-How-to-get-page-instance-from-page-tt2416695.html#none

Thanks in advance for any help.

Cheers,

Jack

Re: T5.1: componentSource with an activation context

Posted by Jack Nuzbit <fn...@googlemail.com>.
Thanks Thiago, that's just what I was looking for.

I'm curious about what you're trying to accomplish here. :)
>

I'm essentially trying to build a managed flow of pages. I have some core
workflow functionality but it varies across different apps and would like to
centralise the configuration in a contribution on a per-app basis. Sounds
fun right? :)




On Fri, Sep 17, 2010 at 5:44 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Fri, 17 Sep 2010 12:58:52 -0300, Jack Nuzbit <fn...@googlemail.com>
> wrote:
>
>  Hi,
>>
>
> Hi!
>
>  Is there a way to create Pages and initialise their activation context at
>> a service level?
>>
>
> I'm curious about what you're trying to accomplish here. :)
>
>
>  Is there a way I can set an activation/event context in this component
>> using existing Tapestry services?
>>
>
> You can try doing exact the same thing components do to trigger events: the
> ComponentResources triggerEvent(...) method in your returned page instance.
> To get the ComponentResources for a given Component, use
> getComponentResources(). Never tried it myself, though.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5.1: componentSource with an activation context

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 17 Sep 2010 12:58:52 -0300, Jack Nuzbit <fn...@googlemail.com>  
wrote:

> Hi,

Hi!

> Is there a way to create Pages and initialise their activation context  
> at a service level?

I'm curious about what you're trying to accomplish here. :)

> Is there a way I can set an activation/event context in this component  
> using existing Tapestry services?

You can try doing exact the same thing components do to trigger events:  
the ComponentResources triggerEvent(...) method in your returned page  
instance. To get the ComponentResources for a given Component, use  
getComponentResources(). Never tried it myself, though.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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