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

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"


In the IDE, right-click on the com.packtpub.celebrities.components
package and add to it two message catalogs, DateInput.properties and
DateInput_de.properties. Put an error message into them, like this:
too-early=The date is too early!
Creating Custom Components
[ 222 ]
Also add an Errors component and a Submit button to the form containing the
DateInput component:


Date test:
t:dateFrom="lowerLimit"/>


Now we are ready to see how our simple validation works. Run the application,
navigate to the page where you have placed the DateInput component and try to
submit some date from the past. This is what you should see:
We were able to successfully plug our custom validation into the existing Tapestry
infrastructure, and so with minimal efforts we have achieved quite a substantial
result. We have also built a decent custom component in the last few sections, and if
you think it could be better, you can always use it as a basis for your own powerful,
feature-rich solution for date input.
Now let's try creating another useful component.


Pages:
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
BET AT HOME sprzęt laboratoryjny fotografia slubna warszawa drapaki dla kotów biustonosze dla mam