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

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

gif}" align="absmiddle"/>
t:encoder="localeEncoder"
onchange="this.form.submit()"/>


Creating Custom Components
[ 226 ]
As for the Select component, almost everything should be familiar to you. One new
addition is the use of the onchange attribute and a tiny bit of JavaScript for its value.
This will ensure that whenever a new option is selected in the resulting drop-down
list, the form surrounding the component will get submitted automatically (in this
case initiating the change of the application's locale).
But if you look closely at how the image is obtained to display a flag, you will notice
something different. This is how the image is provided now:
${asset:images/flag.gif}
And here is how a similar image was obtained in the previous chapter:
${asset:context:/assets/flag.gif}
The main difference is the context: bit. When the context is mentioned while
providing an asset, Tapestry will be looking for that asset relative to the context of
the web application. This means that if the application is deployed on some server,
and its URL is www.someserver.com/celebrities, then anything that goes after
this URL will be the path relative to the application's context.


Pages:
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
praca LoveMe Randki Flirt lokomotywy parowe Opisy telefonów Nokia ogłoszenia