Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-333

Data Grid : PagerModel lastRowForPage starts with 1, instead of zero

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • V1Beta
    • V1Beta
    • NetUI
    • None

    Description

      The PagerModel exposes certain properties which contain the state of the pager.
      They are zero-based (0,1,2,...).

      However, the lastRowForPage starts with 1, instead of zero.

      Test Case:
      1. Use the below index.jsp in a page flow.
      2. Navigate to index.jsp

      Expected Results:
      dataGrid.pagerRenderer.pagerModel.lastRowForPage = 1

      Actual Results:
      dataGrid.pagerRenderer.pagerModel.lastRowForPage = 2

      <snip>
      <%@ page language="java" contentType="text/html;charset=UTF-8"%>
      <%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
      <%@ taglib prefix="netui-data" uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
      <%@ taglib prefix="netui-template" uri="http://beehive.apache.org/netui/tags-template-1.0"%>

      <%
      String [] strings =

      {"0","1","2","3","4","5","6","7"}

      ;
      pageContext.setAttribute("mystrings",strings);
      %>

      <netui:html>
      <head>
      <netui:base/>
      <style type="text/css">
      table.datagrid

      { width="100%" }

      </style>
      </head>
      <netui:body>
      <netui-data:dataGrid dataSource="pageScope.mystrings" name="strings" >
      <netui-data:configurePager pageSize="2" pagerFormat="firstPrevNextLast" disableDefaultPager="false" pageHref="index.jsp"/>
      <netui-data:header>
      <netui-data:headerCell headerText="strings" />
      </netui-data:header>
      <netui-data:caption>
      <table align="left">
      <tr><td><hr /></td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.dataSetSize = ${dataGrid.pagerRenderer.pagerModel.dataSetSize}</td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.pageSize = ${dataGrid.pagerRenderer.pagerModel.pageSize}</td></tr>
      <tr><td><hr /></td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.row = ${dataGrid.pagerRenderer.pagerModel.row}</td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.lastRowForPage = ${dataGrid.pagerRenderer.pagerModel.lastRowForPage}</td></tr>
      <tr><td><hr /></td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.firstPage = ${dataGrid.pagerRenderer.pagerModel.firstPage}</td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.previousPage = ${dataGrid.pagerRenderer.pagerModel.previousPage}</td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.nextPage = ${dataGrid.pagerRenderer.pagerModel.nextPage}</td></tr>
      <tr><td>dataGrid.pagerRenderer.pagerModel.lastPage = ${dataGrid.pagerRenderer.pagerModel.lastPage}</td></tr>
      <tr><td><hr /></td></tr>
      </table>
      </netui-data:caption>
      <netui-data:rows>
      <netui-data:spanCell value="${container.item}" />
      </netui-data:rows>
      </netui-data:dataGrid>
      </netui:body>
      </netui:html>
      </snip>

      Attachments

        Activity

          People

            njantz Nathan Jantz
            ssymmank Scott Symmank
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: