Re: Retrieving Tapestry 4 components from outside Tapestry

2006-09-07 Thread Dan Williams
Thanks for your input guys.
I appreciate your reasoning - I guess I just had a different conceptual idea of
how Tapestry works!
I had already implemented the dummy page solution, but just didn't really like
it - it seemed a little messy against the backdrop of the rest of Tapestry.

If you look through the Tapestry object graph both Pages and Components inherit
from AbstractComponent, implementing both IComponent and IRender interfaces
(amongst others).  I just thought that given this, they were both intended to be
'components' yet indepentantly renderable and differ only in the sense that
Pages are user accessible whereas Components are not, but instead are descrete,
reusable parts.

rgds,
Dan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Retrieving Tapestry 4 components from outside Tapestry

2006-09-07 Thread Dan Williams
Hi,
Thanks for responding!

That's true, but my component is not part of any page - just an isolated
component.

In my original post I used the example of a page (instead of a component) to
highlight how easy it is to do this if your 'component' is a page.  But if your
component is an actual component - and not injected into any page - retrieving
it in a non-tapestry class becomes problematic.

I'm a little confused (and still convinced I'm missing something obvious!) since
I have understood throughout using Tapestry that everything is a component
(including pages), which makes it confusing why pages are so easy to retrieve
this way (via the requestcycle as you pointed out), but Components are not.

Regards,
Dan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Retrieving Tapestry 4 components from outside Tapestry

2006-09-07 Thread Dan Williams
Hi,

I've searched high and low for a definitive answer to this, but so far no luck.

I have a java class, a service class, that needs to retrieve a Tapestry
Component.  This service class is 'outside' of Tapestry in that it's not a page,
not a component, nor does it extend any Tapestry base classes.

My question is: how can my service class retrieve a tapestry component?

If we change things slightly and make my Tapestry component a Page instead, then
this problem has an easy solution: simply pass the IRequestCycle to the service
method and use IRequestCycle.getPage(), but it seems not possible to
retrieve a Component in this way, or am I missing something?!

Short of injecting the component into some page, retrieving that page in my
service then using IPage.getComponent(), I can't see another way.  (And I really
don't want to do it that way!)

Any help would be greatly appreciated.
Thanks,
Dan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]