Is there a good reason not to enhance t:Label to do this? How can I
help to get this implemented (in case I am not the only one who thinks
this would be a good idea)?
Hi Christoph,
one solution could be, to override the whole ComponentDefaultProvider .
You could use the implementation, which comes with the tapestry source
and modify the method defaultLabel to the following:
public String defaultLabel(ComponentResources resources)
{
Defense.notNull(resources, "resources");
String componentId = resources.getId();
String key = componentId + "-label";
Messages containerMessages =
resources.getContainerResources().getMessages();
if (containerMessages.contains(key)) return
containerMessages.get(key);
\\Try without -label
if (containerMessages.contains(componentId)) return
containerMessages.get(componentId);
return TapestryInternalUtils.toUserPresentable(componentId);
}
then you have to contribute this method in you appmodule:
public static void
contributeComponentDefaultProvider(MappedConfiguration<Class,Object>
config){
config.add(ComponentDefaultProvider.class,
MyComponentDefaultProviderImpl());
}
Sorry for not testing this, but have to go to bed now ;)
Greetings
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org