You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ciocoiu Elvis <el...@synthesys.ro> on 2013/03/04 11:10:43 UTC

Re: inmethod grid cachedPageCount

Thank you Paul,

But in my case I'm using IDataSource from immethod grid to retrieve the
current page. In client code after inserting the new record in the database
I'm obtaining the corresponding page number (greater than the one cached by
inmethod grid) and let the grid display itself (internally calls get page
from IDataSource). What I need is the easiest way to update the inmethod
grid to know that there is one more page). The most appropiate idea was to
set the current grid page to the last one but even if the grid let me do
that through its api (used also by the navigator) crashes because of this
internally cached page count. All the logic to retrieve the page based on
the current sort and filter is implemented. I don't want to change the
widget for the moment (inmethod grid is ok except this usecase) so I must
stick to IDataSource and it's usage.
On Feb 28, 2013 3:50 AM, "Paul Bors" <pa...@bors.ws> wrote:

> Well, reading your post a second time around...
>
> If you really want to add a record and then paginate to the page that
> contains it, you'd have to re-run your SQL right?
>
> I think it would make more sence to KISS it. Change your DataProvider by
> re-running the SQL and provide the record ID (primary key, hash or
> something
> unique to your new saved record) then add a new constructor for your table
> or DataProvider to handle the pagination by looking through your collection
> for the element with that unique ID page by page or by implementing the
> pagination in SQL (search with the record ID given your fileters and sort
> order and forward your cursor to the page that contains your record).
>
> Mersi mult, si chiar am nevoie mare :)
>
>
>
> -----
> ~ Thank you,
>     Paul@Bors.ws
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/inmethod-grid-cachedPageCount-tp4656739p4656875.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>