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 152 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

We can also
provide a button for this purpose??”let it be labeled Reset??”using a second Submit
component. Let's position it next to the existing Submit button, using the
following code:
value="Submit"/>
value="Reset"/>
Simple Components
[ 120 ]
And of course, we need an event handler for the new component:
@OnEvent(component="resetButton")
void onResetButton()
{
userName = null;
password = null;
email = null;
gender = null;
subscribe = false;
}
We are simply assigning default values to all the persistent properties here. Test the
application, and everything should work fine.
This chapter is becoming rather long, but there is only one component left of those
we have planned to learn, and this one is very useful.
Select Component
Drop-down lists that allow a user to select one value out of several options are an
important part of web interfaces. In Tapestry, we use a Select component to display
such a drop-down list. Every time we have a fixed set of several options in our code,
we need to think of enumeration, and it is natural that the easiest way to use the
Select component is in combination with an enumeration.


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