I found a solution:
<bean name="dateTranslator" class="my.package.LenientDateTranslator">
<set name="pattern">"dd.MM.yyyy"</set>
<set name="message" value="ognl:page.wrongDateMessage"/>
</bean>
In one line it doesn't work (for me)?!
Rudolf Baloun wrote:
I found the solution in the api:
<bean name="dateTranslator"
class="my.package.LenientDateTranslator,pattern=dd.MM.yyyy,message=Date
Wrong"/>
but can“t use an ognl expression like this:
<bean name="dateTranslator"
class="my.package.LenientDateTranslator,pattern=dd.MM.yyyy,message=ognl:page.wrongDateMessage"/>
is there a solution for my problem?
best regards
Rudolf B.
Rudolf Baloun wrote:
Nice,
i can set the message for the "required" - field with your solution.
But i want to set the message for wrong Data-Input.
My code again:
<bean name="dateTranslator"
class="my.package.LenientDateTranslator,pattern=dd.MM.yyyy"/>
<component id="inputBirthday" type="TextField">
<binding name="displayName" value="ognl:page.messagesUtil.birthdayMsg"/>
<binding name="validators" value="validators:required"/>
<binding name="translator" value="ognl:beans.dateTranslator"/>
<binding name="value" value="ognl:pageBean.customer.ado.birthday"/>
</component>
I cant set the field like this:
<bean name="dateTranslator"
class="my.package.LenientDateTranslator,pattern=dd.MM.yyyy[The date
is wrong]"/>
cause so the [The date is wrong] is intepreted as part of the pattern.
How can i set right?
Best regards
Rudolf B.
Martin Strand wrote:
<binding name="validators" value="validators:required[This is my
message]"/>
or if you want l10n, add a %
<binding name="validators"
value="validators:required[%this.is.my.message.key]"/>
Read more here:
http://jakarta.apache.org/tapestry/UsersGuide/validation.html#validation.fields
On Fri, 27 Jan 2006 12:23:38 +0100, Rudolf Baloun
<[EMAIL PROTECTED]> wrote:
Hi,
i got this code in my *.page:
<bean name="dateTranslator"
class="my.package.LenientDateTranslator,pattern=dd.MM.yyyy"/>
<component id="inputBirthday" type="TextField">
<binding name="displayName"
value="ognl:page.messagesUtil.birthdayMsg"/>
<binding name="validators" value="validators:required"/>
<binding name="translator" value="ognl:beans.dateTranslator"/>
<binding name="value" value="ognl:pageBean.customer.ado.birthday"/>
</component>
I want to add use another validationmessage as the default message.
how can i set the validationmessage?
<binding name="validators" value="validators:required, message=This
is my message"/> doesnt work!?
Anyone knows how to set the message?
best regards
Rudolf B.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]