You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Adam Zimowski <zi...@gmail.com> on 2011/04/08 14:01:30 UTC

T5: required built-in validator not invoked

Hi,

I have a form with a required textfield companyName, and a form
fragment which is displayed if one of the radio buttons on the form is
clicked. When form fragment is hidden, companyName is validated by
Tapestry if not provided (required validation), but when form fragment
is visible, Tapestry does not perform required companyName validation,
and if not provided, companyName comes over with null value.

My client side validation is completely disabled.

My expectation is that Tapestry should always validate required field,
if it is not part of a form fragment. Is my expectation wrong?

Here is the TML:

		<t:form t:id="newUserForm" style="border:solid 1px
grey;margin-top:10px;width:400px;padding:5px;">
		<h3 style="margin-top:0px;">New User</h3>
			<t:label for="companyName"/>: <t:textfield t:id="companyName"
t:value="companyName" t:validate="required"/>
			<t:error for="companyName" class="literal:kk-error"/>
			<hr/>
			<div>
			<b><t:label for="registrationType"/></b>:
			<t:error for="registrationType" class="literal:kk-error"/>
			<t:radiogroup t:id="registrationType">
			  <div><t:radio t:id="new"/> <t:label for="new"/></div>
			  <div><t:radio t:id="existing" t:mixins="triggerfragment"
fragment="existingCustomerInfo"/> <t:label for="existing"/></div>
			</t:radiogroup>
		<t:formfragment t:id="existingCustomerInfo"
visible="existingCustomerInfoEnabled">
			<t:if test="existingCustomerError">
			 <t:error for="accountNumber" class="literal:kk-error"/>
			</t:if>
			<div><t:label for="accountNumber"/>: <t:textfield
t:id="accountNumber"/></div>
			<t:if test="existingCustomerError" negate="true">
			 <t:error for="accountNumber" class="literal:kk-error"/>
			</t:if>
			<b>${message:or}</b>
			<div><t:label for="catalogPriorityCode"/>: <t:textfield
t:id="catalogPriorityCode"/></div>
			<t:if test="existingCustomerError" negate="true">
			 <t:error for="catalogPriorityCode" class="literal:kk-error"/>
			</t:if>
		</t:formfragment>
			<p><t:submit value="Register Now"/></p>


Adam

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