The validators binding is meant for static initialization parameters
only. If you want to use dynamic initialization parameters, use the
bean approach that you used in Tapestry 3.
e.g.
<bean name="required" class="org.apache.tapestry.form.valid.Required"/>
<bean name="maxLength" class="org.apache.tapestry.form.valid.MaxLength">
<set name="maxLength" value="page.config.maxLength"/>
</bean>
<component id="..." type="TextField">
<!-- ... -->
<property name="validators" value="{beans.required, beans.maxLength}"/>
<!-- ... -->
</component>
Jone.hwk wrote:
Hi,
I'd like to change the "maxLength" at runtime for the validator settings:
validators="validators:required,maxLength=page.config.maxLength",but exception
always thrown:
Error initializing validator 'maxLength' (class
com.test.tapestry.valid.MaxLength): Unable to convert 'page.config.maxLength'
to type int (for property maxLength of object
[EMAIL PROTECTED]): 'page.config.maxLength'
Is there a way to fix the problem?
thanks
Jone.hwk
---------------------------------------------------------------------
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]