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

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

Try something like this:

Date test:


Providing a label like this worked fine before with other components, but it will not
work with DateInput. Tapestry will complain that it "Could not find coercion from
type com.packtpub.celebrities.components.DateInput to type org.apache.tapestry.
Field". In other words, Tapestry expected that DateInput is an instance of Field,
while it isn't. So let's make it to be a Field then!
Making DateInput a Field
To be a rightful member of the family of Form components that receive user input
and can display validation errors, a custom component should implement the Field
interface that contains four methods:
String getClientId()??”should return a unique ID for the
given component.
String getLabel()??”naturally, should return a label.
String getElementName()??”should return a name that will become the
content of the component's name attribute.
??? ??? ???
Creating Custom Components
[ 218 ]
boolean isDisabled()??”should define whether the component is disabled
(when it is typically greyed out and cannot accept user input).
Let's begin with the simplest.


Pages:
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6