You can inject ComponentResources within a specific component by
injecting it directly.
I asked a similar question earlier in the year, and Thiago & Howard
seemed to think I could get ComponentResources from the Environment and
wire it up via Module.contributeMarkupRenderer &
Module.contributePartialMarkupRenderer.
see posts titled "how to contribute a 'component context' service"
Howard:
"Best bet is to check TapestryModule for examples. Methods
contributeMarkupRenderer() and contributePartialMarkupRenderer()."
Thiago:
"ComponentResources ins't a service. There's class transformation
applied to component and pages classes that inject it. You should get it
from the Environment service by using the peek() or peekRequired()
methods. "
Thiago:
"@Environmental
private ComponentResources componentResources;"
I have been unable to get this to work since ComponentResources is not
in fact available on the Environment.
I guess this is a revival of that thread, and what I'm really asking is
... how do i create a Something (Service/Environmental/Whatever) which
is available to a component (within the scope of the component) which
has access to ComponentResources as well as ComponentClassResolver and
some other 'render time' type stuff.
thanks, Paul.
On 23/11/2010 8:42 PM, Christophe Cordenier wrote:
Hi,
ComponentResources is not a service, its related to a Component. You can get
the ComponentResources of a specific component by injecting the
ComponentSource service and call the getComponentResources() on it
I remember a thread already exists on this, have a look on markmail.
Christophe.
2010/11/23 Paul Stanton<p...@mapshed.com.au>
Hi all,
I am writing a service I intend to inject into some pages and components:
public MyPage
{
@Inject private MyService myService;
}
I want MyServiceImpl to have access to ComponentResources
public MyServiceImpl implements MyService
{
@Inject private ComponentResources componentResources;
}
however this causes an exception:
Caused by: java.lang.RuntimeException: No service implements the interface
org.apache.tapestry5.ComponentResources.
at
org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:560)
at
org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:44)
at
org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl$1.invoke(MasterObjectProviderImpl.java:56)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
... 123 more
Obviously I'm missing some special plumbing in my AppModule.
What is it?
Thanks, Paul.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org