@Override
protected final CollectionModel createCollectionModel(
CollectionModel current,
Object value)
{
CollectionModel model = super.createCollectionModel(current, value);
RowKeySet selectedRowKeys = getSelectedRowKeys();
if (selectedRowKeys == null)
{
selectedRowKeys = new RowKeySetImpl();
setSelectedRowKeys(selectedRowKeys);
}
RowKeySet disclosedRowKeys = getDisclosedRowKeys();
if (disclosedRowKeys == null)
{
disclosedRowKeys = new RowKeySetImpl();
setDisclosedRowKeys(disclosedRowKeys);
}
selectedRowKeys.setCollectionModel(model);
disclosedRowKeys.setCollectionModel(model);
// If we were perviously sorted, restore the sort order:
if (_sortCriteria != null)
{
model.setSortCriteria(_sortCriteria);
}
return model;
}