I'm using SimplePager and I want to show 11 items(users) per page.
1 empty records + 10 actual records = 11 records per page so
PageSize=11
All my data is 36 items. I want to show text in Simple pager such way
that
Pager should display following values in my pager when PageSize=11 (I
am setting 1 empty record in grid)
i.e 1-10 of 36 11-20 of 36 21-30 of 36 31-36 of 36
Currently I am getting lots of issue like last page showing
unexpected records. (expected 7 = 1 empty + 6 actual records)
pager showing unexpected startIndex ,lastIndex and
dataSize(totalRecordCount)
I am stuck in this pager issue.
Any help or guidance in this matter would be appreciated
Does anyone know what's going wrong?
On Apr 27, 8:03 pm, "bstockiph...@googlemail.com"
<bstockiph...@googlemail.com> wrote:
> I fixed the bug with the invalid enabled "nextpage" button while
> setting setRangeLimited(false) by overwriting the hasNextPage()
> method:
>
> /* (non-Javadoc)
> * @see
> com.google.gwt.user.cellview.client.SimplePager#hasNextPage()
> */
> @Override
> public boolean hasNextPage() {
>
> if(this.getPage()<(this.getPageCount()-1)) {
> return true;
> }
> return false;
> }
>
> On Apr 6, 8:32 pm, Patrick Tucker <patrick.tuc...@macefusion.com>
> wrote:
>
>
>
>
>
>
>
> > It seems my original reply didn't get recorded properly, so I will try
> > again with less detail...
>
> > I noticed that if you call setRangeLimited(false), you get the behavior that
> > you expect, but the forward buttons do not get grayed out.
>
> > If you look at setPageStart(int) is uses isRangeLimited and display's
> > isRowCountExact() values to determine whether or not pageSize records should
> > be shown. If both are true you will get yourpageof pageSize. It seems to
> > me that if isRangeLimited, meaning "whether or not thepagerange should be
> > limited to the actual data", is true you would want to only see the 5
> > remaining records instead of a fullpageof pageSize records.
to avoid this issue, you have to override the
setPageStart(int index) method in the AbstractPager class.
with the following code:
/**
* Set the page start index.
*
* @param index the index
* @see #getPageStart()
*/
protected void setPageStart(int index) {
if (display != null) {
display.setVisibleRange(index,
display.getVisibleRange().getLength());
}
}
This code will set the startindex of the page as expected. But be
careful the size of the CellTable will be reduce, because you have
less rows!
On 10 Nov., 08:09, vaibhav gwt <bhalke.vaib...@gmail.com> wrote:
> Hi
> I am using GWT2.3 Celltable
>
> I'm using SimplePager and I want to show 11 items(users) perpage.
> 1 empty records + 10 actual records = 11 records perpageso
> PageSize=11
>
> All my data is 36 items. I want to show text in Simplepagersuch way
> thatPagershould display following values in mypagerwhen PageSize=11 (I
> am setting 1 empty record in grid)
> i.e 1-10 of 36 11-20 of 36 21-30 of 36 31-36 of 36
>
> Currently I am getting lots of issue likelast pageshowing
> unexpected records. (expected 7 = 1 empty + 6 actual records)pagershowing unexpected startIndex ,lastIndex and
> dataSize(totalRecordCount)
>
> I am stuck in thispager issue.