To override the faulty style, define it in
our application's styles.css file like this:
DIV.t-error LI
{
margin-left: 20px;
}
Do not forget to make the stylesheet available to the page, as described in
the previous chapter.
I hope you will agree that the efforts we had to make to get user input validated are
close to zero. But let's see what Tapestry has done in response to them:
Every form component has a ValidationTracker object associated with
it. It is provided automatically, we do not need to care about it. Basically,
ValidationTracker is the place where any validation problems, if they
happen, are recorded.
As soon as we use the t:validate attribute for a component in the form,
Tapestry will assign to that component one or more validators, the number alidators, the number
, and type of them will depend on the value of the t:validate attribute (more
about this later).
As soon as a validator decides that the value entered associated with the
component is not valid, it records an error in the ValidationTracker. Again,
this happens automatically.
If there are any errors recorded in ValidationTracker, Tapestry will
redisplay the form, decorating the fields with erroneous input and their
labels appropriately.
Pages:
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210