diff --git a/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/BatchRegistrationDialog.java b/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/BatchRegistrationDialog.java index 53eb0e6d4..0cd59eeb1 100644 --- a/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/BatchRegistrationDialog.java +++ b/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/BatchRegistrationDialog.java @@ -147,7 +147,7 @@ private void generateSampleRegistrationLayout() { sampleSpreadsheetLayout.setBatchName(batchInformationLayout.batchNameField.getValue()); ExperimentId selectedExperimentId = batchInformationLayout.experimentSelect.getValue() .experimentId(); - //We only reload the spreadsheet if the selected experiment was changed + //We only reload the spreadsheet if the selected experiment was changed (or dialog closed) if (sampleSpreadsheetLayout.getExperiment() == null || !selectedExperimentId.equals( sampleSpreadsheetLayout.getExperiment())) { sampleSpreadsheetLayout.setExperiment(batchInformationLayout.experimentSelect.getValue()); diff --git a/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleRegistrationSpreadsheet.java b/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleRegistrationSpreadsheet.java index ae2b09812..6270c186f 100644 --- a/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleRegistrationSpreadsheet.java +++ b/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleRegistrationSpreadsheet.java @@ -273,7 +273,7 @@ void unlockCellsToRow(Spreadsheet spreadsheet, int maxRow, int column) { //an unused cell is either null or empty (not blank) private boolean isCellUnused(Cell cell) { - return cell == null || cell.getStringCellValue().isEmpty(); + return cell == null || SpreadsheetMethods.cellToStringOrNull(cell).isEmpty(); } @@ -293,7 +293,7 @@ void fixColumnWidth(int colIndex, String colLabel, if (cell == null) { this.createCell(0, colIndex, spacingValue); } else { - oldValue = cell.getStringCellValue(); + oldValue = SpreadsheetMethods.cellToStringOrNull(cell); this.getCell(0, colIndex).setCellValue(spacingValue); } //Todo Find out why switching from a sheet with less columns to a sheet with more columns breaks the sheet(e.g. lipidomics to genomics) diff --git a/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleSpreadsheetLayout.java b/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleSpreadsheetLayout.java index df29a3768..caba524c5 100644 --- a/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleSpreadsheetLayout.java +++ b/vaadinfrontend/src/main/java/life/qbic/datamanager/views/projects/project/samples/registration/batch/SampleSpreadsheetLayout.java @@ -93,6 +93,8 @@ public void generateSampleRegistrationSheet(MetadataType metaDataType) { } public void reset() { + //this needs to be reset when dialog is closed, as the sheet will not be recreated for set experiments + experiment = null; sampleInformationLayoutHandler.reset(); }