SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 149 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

This is how it
will look then:
value="Submit"/>
We also need to add an event handler for this button to the Registration page class:
@OnEvent(component="submitButton")
void onSubmitButton()
{
System.out.println("Submit button was pressed!");
// TODO: Some code to actually register the user
}
Simple Components
[ 118 ]
Run the application, enter some values into the registration form and submit it by
clicking on the button. You should see an output similar to this:
Setting user name: john
Setting password: abc
Setting gender: MALE
Setting subscribe: false
Submit button was pressed!
The form was submitted!
The event handler for the submit control runs exactly before the form submission
handler, and so all the values submitted by the user are available to it.
Now, to give the logic of the page some completion, we shall perhaps want to imitate
user registration??”create a new User object, fill it with information submitted in the
form (although we don't have any details for this at the moment) and store the object
into the ASO. We shall also want to display another page, ShowAll, at the end. First
of all, let's make the User ASO available at the Registration page:
@ApplicationState
private User user;
Then we need to create an event handler for the Submit component.


Pages:
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6