Show the User a Record Count
February 26th, 2007I came across this in the JDeveloper Help file. This will display something similar to Record 1-10 of 100. Notice that if the estimated row count is less than the range size (rowcount 5, range size 10) the result is Record 1 of 5. Also, I had to write some logic here for the paging when a user is simply paging by NextSet. If they page all of the way in this fashion and the last page shows less than the range size, the result would have been like Record 1-110 of 98. To repair this, I check if the range start plus range size is more than estimated row count, I use the estimated row count, resulting in Record 1-98 of 98. This will give the use an idea of how many rows are paged, and where they are in the paging.
<c:choose>
<c:when test=”${bindings.AllContractsView1Iterator.estimatedRowCount > 0}”>
<c:choose>
<c:when test=”${bindings.AllContractsView1Iterator.estimatedRowCount < bindings.AllContractsView1Iterator.rangeSize}”>
Record <c:out value=”${bindings.AllContractsView1Iterator.rangeStart + 1}”/> of <c:out value=”${bindings.AllContractsView1Iterator.estimatedRowCount}”/>
</c:when>
<c:when test=”${bindings.AllContractsView1Iterator.rangeStart + bindings.AllContractsView1Iterator.rangeSize > bindings.AllContractsView1Iterator.estimatedRowCount}”>
Record <c:out value=”${bindings.AllContractsView1Iterator.rangeStart + 1}”/>-<c:out value=”${bindings.AllContractsView1Iterator.estimatedRowCount}”/> of <c:out value=”${bindings.AllContractsView1Iterator.estimatedRowCount}”/>
</c:when>
<c:otherwise>
Record <c:out value=”${bindings.AllContractsView1Iterator.rangeStart + 1}”/>-<c:out value=”${bindings.AllContractsView1Iterator.rangeStart + bindings.AllContractsView1Iterator.rangeSize}”/> of <c:out value=”${bindings.AllContractsView1Iterator.estimatedRowCount}”/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>