Hi Bob - finally figured it out - the tl;dr version is that my debugger lied :)

Thanks, Damian


On Wed, Oct 12, 2011 at 7:36 AM, Bob Schellink <[email protected]> wrote:
> Are you invoking table.restoreState perhaps?
> Are there any incoming request parameter that could reset the page?
> Specifically the parameter "page"?
>
> regards
>
> Bob
>
> On Wed, Oct 12, 2011 at 4:10 PM, Damian Penney <[email protected]> wrote:
>> Hmm - well it's still not working as expected but I think part of the
>> issue is that inspecting rowList in the debugger was a bit like
>> looking at Schrodingers cat in that the debugger was calling the
>> getter for rowList thus populating it.
>>
>> However in my table init and at the end of my page init I set the
>> pagenumber to table.getNumPages -1 and I see it occur in the debugger
>> but then by the time it gets to onRender and calls createRowList
>> pageNumber has been reset to zero. Where might this be happening?
>>
>> Damian
>>
>>
>> On Tue, Oct 11, 2011 at 10:52 PM, Damian Penney <[email protected]> wrote:
>>> So this is what I'm seeing as I step through
>>>
>>> performOnInit is called which calls onInit in my page class - within onInit
>>>
>>> I set the dataprovider via
>>>
>>>
>>>
>>>       pTable.setDataProvider(new PagingDataProvider<pItem>() {
>>>
>>>            int size = p.size();
>>>
>>>            public int size() {
>>>                return size;
>>>            }
>>>
>>>            public Iterable<PItem> getData() {
>>>                int start = pTable.getFirstRow();
>>>
>>>                final int pagedEnd = start + pTable.getPageSize();
>>>                int end = pagedEnd < this.size ? pagedEnd : size;
>>>
>>>                return pItems.subList(start, end);
>>>            }
>>>        });
>>>
>>>
>>>
>>> setDataProvider then calls setRowList(null)
>>>
>>> But at this point I see that rowList is populated with my first page
>>> of data even though I have a break point on the getdata method (and
>>> createrowlist) of my pagingdataprovider - when did the rowlist get
>>> populated?
>>>
>>> I'm also overriding the init method of the table where I set the page
>>> to the last page - the page renders with the paginator showing the
>>> last page highligted but the dataset shows my first page of data..
>>>
>>> (adding table.onProcess doesn't appear to change anything)
>>>
>>>
>>> Any ideas most welcome - seems as though my debugger is missing
>>> something, not sure what though.
>>>
>>> Thanks, Damian
>>>
>>> On Mon, Oct 10, 2011 at 10:30 PM, Damian Penney <[email protected]> wrote:
>>>> What is the most efficient way to have a table with a paginator
>>>> initially render the last page of data?
>>>>
>>>> I'm trying to call setPageNumber(table.getNumPages()) but the rowlist
>>>> is already created before I can sneak in. Tried overriding the init
>>>> method of the table but still no dice.
>>>>
>>>> Any pointers appreciated.
>>>>
>>>> Thanks, Damian
>>>>
>>>
>>
>

Reply via email to