This repository was archived by the owner on May 5, 2021. It is now read-only.
File tree 2 files changed +6
-1
lines changed
sormas-ui/src/main/java/de/symeda/sormas/ui/samples
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,10 @@ private void saveSample(SampleCreateForm createForm) {
174
174
pathogenTest .setTestedDisease ((Disease ) (createForm .getField (PathogenTestDto .TESTED_DISEASE )).getValue ());
175
175
pathogenTest .setTestDateTime ((Date ) (createForm .getField (PathogenTestDto .TEST_DATE_TIME )).getValue ());
176
176
pathogenTest .setTestResultText ((String ) (createForm .getField (PathogenTestDto .TEST_RESULT_TEXT )).getValue ());
177
- pathogenTest .setCqValue (Float .parseFloat ((String ) createForm .getField (PathogenTestDto .CQ_VALUE ).getValue ()));
177
+ String cqValue = (String ) createForm .getField (PathogenTestDto .CQ_VALUE ).getValue ();
178
+ if (cqValue != null ) {
179
+ pathogenTest .setCqValue (Float .parseFloat (cqValue ));
180
+ }
178
181
FacadeProvider .getSampleFacade ().saveSample (newSample );
179
182
FacadeProvider .getPathogenTestFacade ().savePathogenTest (pathogenTest );
180
183
final EventParticipantReferenceDto eventParticipantRef = newSample .getAssociatedEventParticipant ();
Original file line number Diff line number Diff line change 6
6
import java .util .Arrays ;
7
7
import java .util .Date ;
8
8
9
+ import com .vaadin .v7 .data .util .converter .StringToFloatConverter ;
9
10
import com .vaadin .v7 .ui .CheckBox ;
10
11
import com .vaadin .v7 .ui .ComboBox ;
11
12
import com .vaadin .v7 .ui .TextArea ;
@@ -52,6 +53,7 @@ protected void addFields() {
52
53
ComboBox testTypeField = addCustomField (PathogenTestDto .TEST_TYPE , PathogenTestType .class , ComboBox .class );
53
54
ComboBox testDiseaseField = addCustomField (PathogenTestDto .TESTED_DISEASE , Disease .class , ComboBox .class );
54
55
TextField cqValueField = addCustomField (PathogenTestDto .CQ_VALUE , Float .class , TextField .class );
56
+ cqValueField .setConverter (new StringToFloatConverter ());
55
57
DateTimeField testDateField = addCustomField (
56
58
PathogenTestDto .TEST_DATE_TIME ,
57
59
I18nProperties .getPrefixCaption (PathogenTestDto .I18N_PREFIX , PathogenTestDto .TEST_DATE_TIME ),
You can’t perform that action at this time.
0 commit comments