Odd behavior, I found if I removed the form from the zone it fixed the
issue; however this does not make any sense to me though.

<t:zone t:id="loginRegisterZone" id="loginRegisterZone"></t:zone>

<t:form t:id="registerForm" zone="loginRegisterZone">
<input t:type="textfield" t:id="firstName" placeholder="First Name"
value="userProfile.firstName" class="input-sm"/>
//additional fields
<t:Submit class="btn btn-success" value="Register"/>
</t:form>

On Mon, Oct 13, 2014 at 1:43 PM, George Christman
<gchrist...@cardaddy.com> wrote:
> I'm using 5.4 and for some reason I can not get my ajax form to hold
> onto the field values after a validation error has occurred. When a
> validation error occures all my fields are blanked out. Does anybody
> have any idea what might be causing this?
>
> I have the following code snippet.
>
> <t:zone t:id="loginRegisterZone" id="loginRegisterZone">
> <t:form t:id="registerForm" zone="loginRegisterZone">
> <input t:type="textfield" t:id="firstName" placeholder="First Name"
> value="userProfile.firstName" class="input-sm"/>
> //additional fields
> <t:Submit class="btn btn-success" value="Register"/>
> </t:form>
> </t:zone>
>
>
> @Component(id = "registerForm")
>     private Form registerForm;
>
> @Property
>     private UserProfile userProfile;
>
> public void onPrepareFromRegisterForm() {
>         userProfile = new UserProfile();
>         userProfile.setCreateDate(new Date());
>     }
>
>     boolean onValidateFromRegisterForm() {
>         if (password != null) {
>             userProfile.setPassword(password);
>         }
>
>         if (getEmailExist(userProfile.getEmail())) {
>             registerForm.recordError("");
>             alertManager.alert(Duration.TRANSIENT, Severity.ERROR,
> "Sorry, that email is not available, please try again.");
>             return false;
>         }
>
>         UsernamePasswordToken token = new
> UsernamePasswordToken(userProfile.getEmail(), password);
>         token.setRememberMe(true);
>
>         currentUser.login(token);
>
>         try {
>             currentUser.login(token);
>         } catch (AuthenticationException e) {
>             throw new LockedAccountException(e);
>         }
>
>         return true;
>     }



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

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

Reply via email to