This commit is contained in:
2024-11-25 20:23:41 +03:00
parent f66790f67a
commit 784e4dbbca
4 changed files with 8 additions and 12 deletions

View File

@@ -451,7 +451,7 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
if (needsCurrent() && (getCurrent() != null)) {
savedCurrentKey = getCurrent().getPK();
}
savedSelectedKeys = getSelectedKeys();
savedSelectedKeys = getAllSelectedKeys();
}
public void RestoreLastCurrent() {
for (Object key : savedSelectedKeys) {
@@ -472,6 +472,10 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
return dataSource.Data.values().stream().filter(d -> isObjectVisible(d) && d.isSelected()).collect(Collectors.toCollection(Vector::new));
}
public Vector<Object> getSelectedKeys() {
return dataSource.Data.values().stream().filter(d -> isObjectVisible(d) && d.isSelected()).map(d -> d.getPK()).collect(Collectors.toCollection(Vector::new));
}
//в том числе и невидимые. нужно для сохранения галок при перезакачке бд.
public Vector<Object> getAllSelectedKeys() {
return dataSource.Data.values().stream().filter(DBObject::isSelected).map(d -> d.getPK()).collect(Collectors.toCollection(Vector::new));
}
public boolean CheckCurrent(TextLog log) {