I use external paging / sorting using the special TableDecorator and the following DisplayTag table in JSP:
<display:table id="ixnlist" name="pageScope.itemList" sort="external"
decorator="org.mdibl.ctd.pwa.displaytag.decorator.IxnTableWrapper">
<display:column title="Row" property="rowNum" />
...more columns...
</display:table>
In the table decorator, getListIndex () returns a line number that applies only to the current page, and not to the general list (i.e. if we show 100 objects per page, then getListIndex () returns "0" at the top of page 2, not " one hundred" ).
public String getRowNum() {
final StringBuilder out = new StringBuilder(8);
out.append(nf.format(getListIndex() + 1))
.append('.');
return out.toString();
}
Is it possible in the table decorator to somehow get the row number reflecting the correct shift? Displaytag is aware of some kind of bias because it uses it to format page links.
Displaytag docs don't solve this issue, and the implicit $ {row_rowNum} object works the same way with getListIndex () in the decorator.
, , SQL TableDecorator, , DAO . TableDecorator rownum, , getListIndex():
public String getRowNum() {
final StringBuilder out = new StringBuilder(8);
final Map row = (Map) getCurrentRowObject();
if (row.get("rnum") != null) {
out.append(nf.format(row.get("rnum")));
} else {
out.append(nf.format(getListIndex() + 1));
}
out.append('.');
return out.toString();
}
.
/MCR