Hi!

In our existing app, we always used the following pattern for the standard
validation messages:

validation.message.required = The field {0} is required. Please enter a
value and try again.
validation.message.date = You need to enter a valid date in the {0} field.

You probably get the pattern here. We provide generic messages that only
needs to know the name/label for the field. The background is that we have
thousands of messages in our message catalogue, with translations to many
languages. It just doesn't scale well for us to tailor the validation
message for every form and form field we create.

One sweet feature for us would be to gain access to the body of the
<t:label> component to input that string into our generic validation
messages. I don't like having to do this for every time I specify validation
on a field. Is it possible to advise a Tapestry service about this? The
service would do the following:

1. Get the static message key for a validation type
2. Get the field name from the label component, if any.
3. Calculate the message based on the key and the field name as a parameter.

Thanks for any input!

Inge

Reply via email to