Details
Description
AbstractPageableView declares:
private transient int cachedItemCount;
When this is deserialized, cachedItemCount gets set to 0. This means that the method isItemCountCached() will return true on a deserialized AbstractPageableView. This, in turn, causes getCurrentPage() to return 0, even when the user is not navigating the first page.
For me, this is causing huge problems with the paging navigator.
My current workaround is this is to add this method to my DataView implementation:
private Object readResolve() throws ObjectStreamException {
final Class<?> myClass = getClass();
final Class<?> dataView = myClass.getSuperclass();
final Class<?> dataViewBase = dataView.getSuperclass();
final Class<?> abstractPagableView = dataViewBase.getSuperclass();
try
catch (Exception e)
{ throw new RuntimeException(e); } return this;
}
Obviously it would be better if the AbstractPagingView could take care of this itself.
Attachments
Issue Links
- causes
-
WICKET-6644 AbstractPageableView can only be serialized with Java built-in serialization
- Resolved