You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martijn Hinten <ma...@cumquat.nl> on 2006/05/09 22:03:20 UTC

[SOLVED] How to pass in a message key *and* parameters into a ValidationDelegate

Just for the record: I solved it. It appears that the ValidationDelegate 
is *not* looking up messages in the resource bundle, but that my own 
code did just that, a bit further down the line. So my own code tried to 
look up a message that was allready the result of a resource bundle 
lookup, and hence did not find it. Fixed my own code and now all works fine.

Ciao,
Martijn

Martijn Hinten wrote:

> Hi,
>
> The method
>
> record(String message, ValidationConstraint constraint)
>
> of
>
> org.apache.tapestry.valid.ValidationDelegate
>
> will lookup any message automatically in the message property file. 
> However there does not seem to be a record-method that allows me to 
> pass in both the message-key and any substitution parameters, for example
>
> // DOES NOT EXIST:
> record(String message, String[] parameters, ValidationConstraint 
> constraint)
>
> When I try to trick Tapestry, by formatting the message myself, before 
> passing it in, like this:
>
> record(getMessages().formatMessage("my-key",new String{"My-param"}, null)
>
> ..it will still try to lookup the complete formatted message in the 
> property file, and - obviously - won't find it and I end up with the 
> complete message text capitalized, between brackets ( like this: 
> "[HELLO THIS IS MY MESSAGE WITH MY PARAM: FOO]").
>
> Does anybody out there know of any way to either:
> - pass in message-substitution-paramaters into ValidationDelegate's 
> record() method
> - disable ValidationDelegate's record() method from looking up 
> messages in the property file, so that I can pass in a pre-formatted 
> message
>
> Thanks for any input. I did look into the archives and didn't find an 
> answer yet. If I overlooked it, my humble apologies.
>
>
> Thanks,
> Martijn
>

-- 


*Cumquat Information Technology*
De Dreef 19
3706 BR Zeist
T +31 (0)30 - 6940490
F +31 (0)10 - 6940499
http://www.cumquat.nl <http://www.cumquat.nl/>

martijn.hinten@cumquat.nl <ma...@cumquat.nl>
M +31 6 22 384 318


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