Instead, we shall
provide our own way of displaying the cells of the table that contain the last name.
Here is how we do this:
row="celebrity">
${celebrity.lastName}
Here, the Grid component contains a special Tapestry element
,
similar to the one that we used in the previous chapter, inside the If component. As
before, it serves to provide an alternative content to display, in this case, the content
which will fill in the cells of the Last Name column. How does Tapestry know this?
By the name of the element, lastNameCell. The first part of this name, lastName, is
the name of one of the properties of the displayed objects. The last part, Cell, tells
Tapestry that it is about the content of the table cells displaying the specified property.
Advanced Components
[ 132 ]
Finally, inside , you can see an expansion displaying the name of the
current celebrity and surrounding it with the PageLink component that has for its
context the ID of the current celebrity.
Run the application, and you should see that we have achieved what we wanted:
Click on the last name of a celebrity, and you should see the Details page with the
appropriate details on it.
Pages:
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179