You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Daniel Lydiard <dl...@hotmail.com> on 2006/01/25 06:56:25 UTC

@Persist and TextField validators binding

I have an email field:
  <component id="emailField" type="TextField">
    <binding name="value" value="email"/>
    <binding name="validators" value="validators:required,email"/>
    <binding name="displayName" value="literal:your e-mail address"/>
  </component>

Then in the Java code:
  @Persist
  public abstract String getEmail();


Situation:
1. Users enters a perfectly valid email and submits, but some other field 
fails (the field is NOT using a validators binding, but fails within a 
validation method call that further validates the other field) and the same 
page is reloaded.
2. User now enters an invalid email address (one that doesn't pass the email 
validation) and hits submit.
3. The value of the getEmail textfield remains the same value as step 1, 
even though the value from step 2 was invalid.

This only happens if @Persists is used.

The reason of making it persistant is because the page is part of a wizard 
(back + forward navigation within the wizard).  This funtionality seemed to 
work fine with 3.0 as far as I can tell.

I could check for validationDelegate getHasErrors() before hand, but i still 
want the validation method i have to further validate the other fields, so 
the user can see everything that's wrong in one submit.

Any ideas?

Thanks.


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