PDA

View Full Version : GXT 2.0.1 - XmlPagingLoadResultReader buggy - proposed fix



bgrieder
27 Aug 2009, 6:44 AM
Hi,

The PagingToolBar does not work in 2.0.1 using an XmlPagingLoadResultReader.

The protected method createReturnData should be overriden in XmlPagingLoadResultReader so that the PagingLoadResult object instance returned has a correct offset value.

This offset value is used in the PagingToolBar onLoad(LoadEvent e) method to recalculate the
activePage.

The proposed fix is to implement with an override the method createReturnData in XmlPagingLoadResultReader with




@Override
protected Object createReturnData(Object loadConfig, List<ModelData> records, int totalCount) {
Object result = super.createReturnData(loadConfig, records, totalCount);
if (result instanceof PagingLoadResult) {
PagingLoadResult<?> r = (PagingLoadResult<?>) result;
r.setTotalLength(totalCount);
r.setOffset(((PagingLoadConfig)loadConfig).getOffset());
}
return result;
}




Bruno

www.amalto.com

sven
27 Aug 2009, 6:48 AM
This is already fixed in SVN