panelGrid.setColumns(2);
panelGrid.setWidth("100%");
panelGrid.setColumnClasses("nav,count");
// create navigation panel
HtmlPanelGroup navigationPanelGroup = new HtmlPanelGroup();
panelGrid.getChildren().add(navigationPanelGroup);
outText = makeResultText(facesContext, sMsg);
navigationPanelGroup.getChildren().add(outText);
int linkCount = 0;
// add page navigation links
if (nTotalPageCount > 1) {
// first and previous pages
if (cursor.getHasPreviousPage()) {
if (nStartPage != 1) {
sMsg = msgBroker.retrieveMessage(sKeyPfx + "first");
cmdLink = makePageLink(facesContext, 1, sMsg, isBottom, ++linkCount);
navigationPanelGroup.getChildren().add(cmdLink);
}
nPage = cursor.getPreviousPage();
sMsg = msgBroker.retrieveMessage(sKeyPfx + "previous");
cmdLink = makePageLink(facesContext, nPage, sMsg, isBottom, ++linkCount);
navigationPanelGroup.getChildren().add(cmdLink);
}
// pages
for (int i = nStartPage; i <= nEndPage; i++) {
cmdLink = makePageLink(facesContext, i, "" + i, isBottom, ++linkCount);
navigationPanelGroup.getChildren().add(cmdLink);
}
// next and last pages
if (cursor.getHasNextPage()) {
nPage = cursor.getNextPage();
sMsg = msgBroker.retrieveMessage(sKeyPfx + "next");
cmdLink = makePageLink(facesContext, nPage, sMsg, isBottom, ++linkCount);
navigationPanelGroup.getChildren().add(cmdLink);
if (nEndPage != nTotalPageCount) {
sMsg = msgBroker.retrieveMessage(sKeyPfx + "last");
cmdLink = makePageLink(facesContext, nTotalPageCount, sMsg, isBottom, ++linkCount);
navigationPanelGroup.getChildren().add(cmdLink);
}
}
}
// create records per page panel
if (!isBottom && getChangeListenerExpression().length()>0) {
HtmlPanelGroup resultsPerPagePanelGroup = new HtmlPanelGroup();
panelGrid.getChildren().add(resultsPerPagePanelGroup);
// listbox id
String listBoxId = "recsPerPage";
// Display label
HtmlOutputLabel resultsPerPageLabel =
makeResultsLabel(facesContext, sRecordsPerPageMsg);
resultsPerPagePanelGroup.getChildren().add(resultsPerPageLabel);
resultsPerPageLabel.setFor(listBoxId);
// Create lisbox
HtmlSelectOneListbox listBox = new HtmlSelectOneListbox();
resultsPerPagePanelGroup.getChildren().add(listBox);
listBox.setId(listBoxId);
listBox.setSize(1);
listBox.setValue(Integer.toString(cursor.getRecordsPerPage()));
UIComponent form = findForm(masterPanelGroup);