EODatabaseDataSource ds = (eodatasource instanceof EODatabaseDataSource) ? (EODatabaseDataSource) eodatasource : null;
Object newDataSourceState = null;
if (ds != null) {
newDataSourceState = ds.fetchSpecification().toString().replaceAll("\\n", "") + ":" + ds.fetchSpecificationForFetch().toString().replaceAll("\\n", "") + " fetchLimit: " + ds.fetchSpecification().fetchLimit() + ", " + ds.fetchSpecificationForFetch().fetchLimit();
}
EODataSource old = displayGroup().dataSource();
super.setDataSource(eodatasource);
displayGroup().setDataSource(eodatasource);
if (ds == null || (dataSourceState == null) || (dataSourceState != null && !dataSourceState.equals(newDataSourceState)) || alwaysRefetchList()) {
log.debug("updating:\n" + dataSourceState + " vs\n" + newDataSourceState);
dataSourceState = newDataSourceState;
_hasToUpdate = true;
// AK: when you use the page in a embedded component and have a few
// of them in a tab
// page, WO reuses the component for a new dataSource. If this DS
// doesn't have the
// sort order keys required it leads to a KVC error later on. We fix
// this here to re-init
// the sort ordering from the rules.
if (old != null && eodatasource != null && ObjectUtils.notEqual(eodatasource.classDescriptionForObjects(), old.classDescriptionForObjects())) {
setSortOrderingsOnDisplayGroup(sortOrderings(), displayGroup());
}
}
}