ValidationMessages.properties

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ValidationMessages.properties

Adriaan Joubert-3
Hi,

I added a couple of validators to check for int/double values in text
fields. All works great, except that Tapestry cannot find my messages.
I've put messages in app.properties and also in
ValidationMessages.properties, but no matter where I put them they are
not being picked up. Anybody got any ideas?

Thanks,

Adriaan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ValidationMessages.properties

Peter Beshai-2
In your AppModule:

If your properties file is at :
org.myorg.myapp.ValidationMessages.properties, add:

public void contributeValidationMessagesSource(Configuration<String>
configuration)
{
        configuration.add("org/myorg/myapp/ValidationMessages");
}

It's very useful to check how Tapestry sets itself up if you ever have
questions like these. I recommend checking TapestryModule for an answer
before the mailing list :-)
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?view=markup


Peter Beshai

On Wed, Apr 16, 2008 at 12:06 PM, Adriaan Joubert <[hidden email]>
wrote:

> Hi,
>
> I added a couple of validators to check for int/double values in text
> fields. All works great, except that Tapestry cannot find my messages.
> I've put messages in app.properties and also in
> ValidationMessages.properties, but no matter where I put them they are
> not being picked up. Anybody got any ideas?
>
> Thanks,
>
> Adriaan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: ValidationMessages.properties

Adriaan Joubert-3
Excellent, thanks a lot, Peter. Looked in the tapestry init for the
registration of the validation functions, but not for the message
catalogs.

I've added a page to the wiki with a description of adding validators.
For anybody else with the same problems look at

http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators

Any suggestions/corrections welcome.

Cheers,

Adriaan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]