You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Richard Levenberg <ri...@ufp.com> on 2007/07/27 07:48:05 UTC

Problem with Match Validation

Can anyone provide a simple example of using the Match validation of 4.1.2?

I have done everything I can think of to set the match of one TextField
to the id of another. How is the "component to compare against"
specified? Do I need the property tags? using "ognl:verify" causes an
exception. Using just "verify" (not sure if that refers to the component
id or the property), but it doesn't verify even if the values of the
text fields are the same.

r

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
  "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
  "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
 
<page-specification>
  <asset name="stylesheet" path="corp.css"/>
  <property name="passphrase"/>
  <property name="verify"/>
  <component id="passphrase" type="TextField">
    <binding name="value" value="ognl:passphrase"/>
    <binding name="translator" value="translator:string,trim=true"/>
    <binding name="validators"
value="validators:required,minLength=6,match=verify"/>
    <binding name="displayName" value="literal:Passphrase"/>
  </component>
  <component id="verify" type="TextField">
    <binding name="value" value="ognl:verify"/>
    <binding name="translator" value="translator:string,trim=true"/>
    <binding name="validators" value="validators:required"/>
    <binding name="displayName" value="literal:Verify Passphrase"/>
  </component>
  <component id="errors" type="Delegator">
    <binding name="delegate" value="beans.delegate.firstError"/>
  </component>
  <component id="form" type="Form">
    <binding name="delegate" value="beans.delegate"/>
    <binding name="listener" value="ognl:listeners.doSubmit"/>
  </component>
</page-specification>


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