If that's true, then we can actually contribute to the standard
Translators, right?
<contribution configuration-id="Translators">
<bean name="date" class="SpecialTranslator"/>
</contribution>
<bean name="specialTranslator" class="xxx.xxx.SpecialTranslator">
<set name="something" value="someval" />
</bean>
And use it like this:
<component id="dateField" type="DatePicker">
<binding name="translator" value="translator:specialTranslator" />
</component>
--
Ing. Leonardo Quijano Vincenzi
DTQ Software
Ryan Holmes wrote:
In addition to the other recommendations, you can define translators
and validators as beans:
<bean name="dateTranslator"
class="org.apache.tapestry.form.translator.DateTranslator">
<set name="pattern" value="myPattern" />
</bean>
<bean name="minDate"
class="org.apache.tapestry.form.validator.MinDate">
<set name="minDate" value="minValidDate" />
</bean>
<bean name="maxDate"
class="org.apache.tapestry.form.validator.MaxDate">
<set name="maxDate" value="maxValidDate" />
</bean>
And then refer to them in component specs like so:
<component id="dateField" type="DatePicker">
<binding name="value" value="myDate" />
<binding name="translator" value="bean:dateTranslator" />
<binding name="validators"
value="validators:required,$minDate,$maxDate" />
</component>
-Ryan
Leonardo Quijano Vincenzi wrote:
Is there any way to specify dynamic translators, that depend on some
OGNL expression??
Something like this:
<input jwcid="[EMAIL PROTECTED]"
translator="translator:number,pattern=SomeOGNLExpression"
value="ognl:someNumber" />
???
I've been looking around but I didn't found a way to inject the
translator in the page class or something similar.
Ideas?
---------------------------------------------------------------------
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]