The last of the four methods, getRowValue(), returns the entity requested by Grid
using its index as a parameter. You will see how all this works soon.
To make use of the created CelebritySource, add the following method to the
ShowAll page class:
public GridDataSource getCelebritySource()
{
return new CelebritySource(dataSource);
}
Then change the source parameter of the Grid component in ShowAll.tml template:
row="celebrity" t:model="model">
Advanced Components
[ 138 ]
Run the application. Log in to view the ShowAll page, and as soon as the table with
celebrities is displayed, you should see the following output:
Preparing selection.
Index from 0 to 4
Property name is: null
Sorting order ascending: true
Getting value for row 0
Getting value for row 1
Getting value for row 2
Getting value for row 3
Getting value for row 4
From this you can see that to display the first page of results, the Grid component
invoked the methods of the GridDataSource implementation provided by its source
parameter in a certain succession. The output shows that the prepare method was
invoked with the indexFrom parameter set to 0, and the indexTo parameter set to
4.
Pages:
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187