You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rob Bugh <ro...@accuwater.com> on 2004/02/13 00:33:44 UTC

Unable to blank out a ValidField

I'm using a ValidFields in my form and for one of the fields, password, I 
want to blank out each time the page renders and the form delegate 
hasErrors = true. That is, if some other field does not validate (or even 
this one) I want to blank out the password field. In my page class in the 
formSubmit method I zap the value of the user.password property if an 
error condition is detected. This works except when I add a minimumLength 
to the password bean (see below). If my password field does not have the 
minimum required length the password field (as seen on the browser) does 
not clear when some other validation error occurs. If I put the minimum 
length or greater then the field clears.

I've defined a password bean that is reference in the html form:

     <bean name="password" 
class="org.apache.tapestry.valid.StringValidator" lifecycle="page">
         <set-property name="required" expression="true"/>
         <set-property name="minimumLength" expression="6"/>
     </bean>

     <component id="password" type="ValidField">
         <static-binding name="displayName" value="Password"/>
         <binding name="validator" expression="beans.password"/>
         <binding name="value" expression="user.password"/>
     </component>

Any clues as to what I'm doing wrong?

Rob
-- 
Rob Bugh
Accuwater, Inc.

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