I've already tried to inject the ComponentResources into my class without success :-(

public static void contributeComponentClassTransformWorker(OrderedConfiguration<ComponentClassTransformWorker> configuration, PropertyAccess propertyAccess, ComponentResources componentResources) { configuration.add("InjectSelectionModel", new InjectSelectionModelWorker(propertyAccess, componentResources), "after:Inject*");
}

Caused by: java.lang.RuntimeException: No service implements the interface org.apache.tapestry5.ComponentResources. at org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:519) at org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46) at $MasterObjectProvider_11d0a166c14.provide($MasterObjectProvider_11d0a166c14.java) at org.apache.tapestry5.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:624) at org.apache.tapestry5.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:731) at org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:49) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateInjection(InternalUtils.java:206) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:236) at org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParametersForMethod(InternalUtils.java:215) at org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:90)
   ... 100 more

i suppose that the componentResources is not already instantiated at this time ...

Stephane


Howard Lewis Ship a écrit :
Classes are non-localized.

However, you can write code that can access the current Locale or
localed Messages object via the ComponentResources object injected
into each class.

On Thu, Oct 16, 2008 at 2:48 PM, Stephane Decleire
<[EMAIL PROTECTED]> wrote:
Hi everybody,

Is there a way to use Tapestry localization services like Messages in a
ComponentClassTransformWorker ?
My goal is to localize the <SELECT> component described by Marcelo Lotif in
the Tapestry Wiki
(http://wiki.apache.org/tapestry/Tapestry5AnotherSelectWithObjects).

Thanks in advance

Stephane




Reply via email to