Hi,

I'm making a crud application that uses PagingScrollTable. It consists
of a paging grid and a form  that reflects the current selected row. I
use the form to make query by example, so I start with a group of
values and depending on the search I need to populate the grid with
completely different set of values. After the user click the search
button I was trying to reload the values with :

myPagingGrid.gotoPage(0, true); // true to force reload.

I was getting strange results, with values of the last search being
mixed with the ones of the current search.

My mistake was I'm using CachedTableModel, that encapsulate my real
table mode and it was keeping values from the last search around.

final CachedTableModel<Cliente> cachedTableModel = new
CachedTableModel<Cliente>(tableModel);

So cachedTableModel.clearCache() before myPagingGrid.gotoPage(0, true)
solved the problem.

Just wondering:

CachedTableModel extends MutableTableModel which extends TableModel,
and PagingScrollTable points to TableModel, so I can't invoke clear
cache via PagingScrollTable. Instead I have  to pass a instance to
PagingScrollTable and CachedTableModel to be able to:

cachedTableModel.clearCache();
myPagingGrid.gotoPage(0, true);

If TableModel had an abstract clearCache method, I could make:

myPagingGrid.getTableModel().clearCache();
myPagingGrid.gotoPage(0, true);

That would be more clean imho.

Thanks for the marvelous work you are doing.

Geraldo Lopes





--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to