You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Matías Blasi <ma...@gmail.com> on 2012/08/02 06:09:45 UTC

How to override a component message

Hi all!

I'm trying to override a message from the catalog of a component. It is the
LoginForm from the tynamo-security-0.4.6.

It includes a LoginForm.properties with "loginLabel=Login". I added that
message in my app_es.properties (loginLabel=Acceso) with no effect.

What am I missing???

Thank you for any suggestion,
Best regards,
Matias.

Re: How to override a component message

Posted by Matías Blasi <ma...@gmail.com>.
Thank you Howard!

I got it working now!

Regards,
Matias.


On Mon, Aug 6, 2012 at 12:21 PM, Matías Blasi <ma...@gmail.com>wrote:

> Hi all,
>
> I'd like to know if my question is clear, because I can't resolve it yet,
> and I think that I should be missing something obvious...
>
> A component has a <t:label t:for="userName"/>, the same component defines
> userName-label in its component.properties, and I don't know how to
> override that property... I tried in everywhere, my own
> component_es.properties, my app_es.properties, I don't know who has more
> hierarchy in the properties resolution than the component' own properties
> file.
>
> I filed an issue in jira: http://jira.codehaus.org/browse/TYNAMO-173
>
> Best regards,
> Matias.
>
>
>
> On Thu, Aug 2, 2012 at 4:43 PM, Matías Blasi <ma...@gmail.com>wrote:
>
>> Thanks Alex,
>>
>> I have no problem for overriding error messages, I have a custom one
>> which is working.
>> But the field labes, uses a message binding with "loginLabel" key, and it
>> is finding it in LoginForm.properties and I don't know where to override it.
>>
>> Best regards,
>> Matias.
>>
>>
>>
>> On Thu, Aug 2, 2012 at 1:09 AM, Matías Blasi <ma...@gmail.com>wrote:
>>
>>> Hi all!
>>>
>>> I'm trying to override a message from the catalog of a component. It is
>>> the LoginForm from the tynamo-security-0.4.6.
>>>
>>> It includes a LoginForm.properties with "loginLabel=Login". I added that
>>> message in my app_es.properties (loginLabel=Acceso) with no effect.
>>>
>>> What am I missing???
>>>
>>> Thank you for any suggestion,
>>> Best regards,
>>> Matias.
>>>
>>
>>
>

Re: How to override a component message

Posted by Howard Lewis Ship <hl...@gmail.com>.
The only way to override a message key in a component's message
catalog is to subclass the component, and provide a new message
catalog (that implicitly extends the super-class message catalog).

On Mon, Aug 6, 2012 at 8:21 AM, Matías Blasi <ma...@gmail.com> wrote:
> Hi all,
>
> I'd like to know if my question is clear, because I can't resolve it yet,
> and I think that I should be missing something obvious...
>
> A component has a <t:label t:for="userName"/>, the same component defines
> userName-label in its component.properties, and I don't know how to
> override that property... I tried in everywhere, my own
> component_es.properties, my app_es.properties, I don't know who has more
> hierarchy in the properties resolution than the component' own properties
> file.
>
> I filed an issue in jira: http://jira.codehaus.org/browse/TYNAMO-173
>
> Best regards,
> Matias.
>
>
> On Thu, Aug 2, 2012 at 4:43 PM, Matías Blasi <ma...@gmail.com> wrote:
>
>> Thanks Alex,
>>
>> I have no problem for overriding error messages, I have a custom one which
>> is working.
>> But the field labes, uses a message binding with "loginLabel" key, and it
>> is finding it in LoginForm.properties and I don't know where to override it.
>>
>> Best regards,
>> Matias.
>>
>>
>>
>> On Thu, Aug 2, 2012 at 1:09 AM, Matías Blasi <ma...@gmail.com>wrote:
>>
>>> Hi all!
>>>
>>> I'm trying to override a message from the catalog of a component. It is
>>> the LoginForm from the tynamo-security-0.4.6.
>>>
>>> It includes a LoginForm.properties with "loginLabel=Login". I added that
>>> message in my app_es.properties (loginLabel=Acceso) with no effect.
>>>
>>> What am I missing???
>>>
>>> Thank you for any suggestion,
>>> Best regards,
>>> Matias.
>>>
>>
>>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: How to override a component message

Posted by Alejandro Scandroli <al...@gmail.com>.
Hola Matías

The issue is that the LoginForm.properties file is resolving the
message and not allowing the call chain to get to the global
(application-wide) message catalog.
I think you could get away with it if you add the
LoginForm_es.properties file in the right place, that is:
src/main/resources/org/tynamo/security/components/LoginForm_<lang>.properties

Un saludo.
Alejandro.


On Mon, Aug 6, 2012 at 5:21 PM, Matías Blasi <ma...@gmail.com> wrote:
> Hi all,
>
> I'd like to know if my question is clear, because I can't resolve it yet,
> and I think that I should be missing something obvious...
>
> A component has a <t:label t:for="userName"/>, the same component defines
> userName-label in its component.properties, and I don't know how to
> override that property... I tried in everywhere, my own
> component_es.properties, my app_es.properties, I don't know who has more
> hierarchy in the properties resolution than the component' own properties
> file.
>
> I filed an issue in jira: http://jira.codehaus.org/browse/TYNAMO-173
>
> Best regards,
> Matias.
>
>
> On Thu, Aug 2, 2012 at 4:43 PM, Matías Blasi <ma...@gmail.com> wrote:
>
>> Thanks Alex,
>>
>> I have no problem for overriding error messages, I have a custom one which
>> is working.
>> But the field labes, uses a message binding with "loginLabel" key, and it
>> is finding it in LoginForm.properties and I don't know where to override it.
>>
>> Best regards,
>> Matias.
>>
>>
>>
>> On Thu, Aug 2, 2012 at 1:09 AM, Matías Blasi <ma...@gmail.com>wrote:
>>
>>> Hi all!
>>>
>>> I'm trying to override a message from the catalog of a component. It is
>>> the LoginForm from the tynamo-security-0.4.6.
>>>
>>> It includes a LoginForm.properties with "loginLabel=Login". I added that
>>> message in my app_es.properties (loginLabel=Acceso) with no effect.
>>>
>>> What am I missing???
>>>
>>> Thank you for any suggestion,
>>> Best regards,
>>> Matias.
>>>
>>
>>

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


Re: How to override a component message

Posted by Matías Blasi <ma...@gmail.com>.
Hi all,

I'd like to know if my question is clear, because I can't resolve it yet,
and I think that I should be missing something obvious...

A component has a <t:label t:for="userName"/>, the same component defines
userName-label in its component.properties, and I don't know how to
override that property... I tried in everywhere, my own
component_es.properties, my app_es.properties, I don't know who has more
hierarchy in the properties resolution than the component' own properties
file.

I filed an issue in jira: http://jira.codehaus.org/browse/TYNAMO-173

Best regards,
Matias.


On Thu, Aug 2, 2012 at 4:43 PM, Matías Blasi <ma...@gmail.com> wrote:

> Thanks Alex,
>
> I have no problem for overriding error messages, I have a custom one which
> is working.
> But the field labes, uses a message binding with "loginLabel" key, and it
> is finding it in LoginForm.properties and I don't know where to override it.
>
> Best regards,
> Matias.
>
>
>
> On Thu, Aug 2, 2012 at 1:09 AM, Matías Blasi <ma...@gmail.com>wrote:
>
>> Hi all!
>>
>> I'm trying to override a message from the catalog of a component. It is
>> the LoginForm from the tynamo-security-0.4.6.
>>
>> It includes a LoginForm.properties with "loginLabel=Login". I added that
>> message in my app_es.properties (loginLabel=Acceso) with no effect.
>>
>> What am I missing???
>>
>> Thank you for any suggestion,
>> Best regards,
>> Matias.
>>
>
>

Re: How to override a component message

Posted by Matías Blasi <ma...@gmail.com>.
Thanks Alex,

I have no problem for overriding error messages, I have a custom one which
is working.
But the field labes, uses a message binding with "loginLabel" key, and it
is finding it in LoginForm.properties and I don't know where to override it.

Best regards,
Matias.


On Thu, Aug 2, 2012 at 1:09 AM, Matías Blasi <ma...@gmail.com> wrote:

> Hi all!
>
> I'm trying to override a message from the catalog of a component. It is
> the LoginForm from the tynamo-security-0.4.6.
>
> It includes a LoginForm.properties with "loginLabel=Login". I added that
> message in my app_es.properties (loginLabel=Acceso) with no effect.
>
> What am I missing???
>
> Thank you for any suggestion,
> Best regards,
> Matias.
>

Re: How to override a component message

Posted by Alex Kotchnev <ak...@gmail.com>.
Matias,
   the validation page has a snippet of info (
http://tapestry.apache.org/forms-and-validation.html ) on the validation
message selection from the message catalog. So, specifically on overriding
the tynamo login form error message, I have the following in app.properties:

tynamoLoginForm-tynamoLogin-required-message=You must provide a value for
Login.
tynamoLoginForm-tynamoPassword-required-message=You must provide a value
for Password.

Cheers - Alex K

-------

The message can be customized by adding an entry to the page's message
catalog <http://tapestry.apache.org/localization.html> (or the containing
component's message catalog). As with any localized property, this can also
go into the application's message catalog.

The first key checked is *formId*-*fieldId*-*validatorName*-message.

   - formId: the local component id of the Form component
   - fieldId: the local component id of the field (TextField, etc.)
   - validatorName: the name of the validator, i.e., "required" or
   "minlength"
   If there is not message for that key, a second check is made, for *
   fieldId*-*validatorName*-message.

----------

On Thu, Aug 2, 2012 at 12:09 AM, Matías Blasi <ma...@gmail.com>wrote:

> Hi all!
>
> I'm trying to override a message from the catalog of a component. It is the
> LoginForm from the tynamo-security-0.4.6.
>
> It includes a LoginForm.properties with "loginLabel=Login". I added that
> message in my app_es.properties (loginLabel=Acceso) with no effect.
>
> What am I missing???
>
> Thank you for any suggestion,
> Best regards,
> Matias.
>