{
// Get the index of page this link shall point to
final int pageIndex = getStartIndex() + loopItem.getIteration();
// Add a page link pointing to the page
final AbstractLink link = newPagingNavigationLink("pageLink", pageable, pageIndex);
link.add(new TitleAppender(pageIndex));
loopItem.add(link);
// Add a page number label to the list which is enclosed by the link
String label = "";
if (labelProvider != null)
{
label = labelProvider.getPageLabel(pageIndex);
}
else
{
label = String.valueOf(pageIndex + 1);
}
link.add(new Label("pageNumber", label));
}