Modify the onFormSubmit method to look like this: void onSubmitFromRegistrationForm() { System.out.println("The form was submitted!"); if (unsubscribe) subscribe = false; } Now we can run the application. Go to the Registration page, click on the check box to subscribe for the newsletter and then click on the other check box to restore the original interface. The only problem is that the text box for password doesn't redisplay its value when the page is reloaded, despite the fact that we made password property persistent. This is in the nature of the PasswordField component??”not to redisplay its value. However, we don't want to annoy our user by the need to re-enter the password every time the page is reloaded. What can we do to avoid this? One possible solution is to hide the password fields as soon as the password gets submitted. We can use another If component for this purpose. Modify the Registration page template like this:
Chapter 4 [ 117 ] From the test parameter of this If component, you can see that Tapestry will be looking for the isPasswordNotSubmitted (or getPasswordNotSubmitted) method in the page class.