You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Laurent Vanzeune <la...@s1.com> on 2002/12/20 10:56:51 UTC

Commons-Validator: locale-independent and locale-dependent validations

For some attributes of form beans, I need to define locale-dependent and
locale-independent validations and I don't want to copy paste
locale-independent validations in each locale-dependent formset sections.

I tried with the XML below, but only the validations that match my locale
settings are taken into account.

Is there another way to achieve this?

Thanks,
Laurent.

<form-validation>
	<formset>
		<form name="dataUnitIdForm">
			<field property="fiId" depends="required">
				<arg0 key="dataUnitIdForm.fiId"/>
			</field>
			<field property="feedDate" depends="required">
				<arg0 key="dataUnitIdForm.feedDate"/>
			</field>
		</form>
	</formset>
	<formset language="fr" country="BE">
		<form name="dataUnitIdForm">
			<field property="feedDate" depends="date">
				<var>
                       			<var-name>datePatternStrict</var-name>
                       			<var-value>dd/MM/yyyy</var-value>
                     		</var>
              		</field>
		</form>
	</formset>
	<formset language="en" country="US">
		<form name="dataUnitIdForm">
			<field property="feedDate" depends="date">
				<var>
                       			<var-name>datePatternStrict</var-name>
                       			<var-value>MM/dd/yyyy</var-value>
                     		</var>
              		</field>
		</form>
	</formset>
</form-validation>