@@ -41,11 +41,11 @@ public class SymptomsForm extends AbstractEditForm<SymptomsDto> {
41
41
+ LayoutUtil .h3 (CssStyles .VSPACE3 , "Recent symptoms" )
42
42
+ LayoutUtil .divCss (CssStyles .VSPACE3 ,
43
43
LayoutUtil .fluidRowLocs (SymptomsDto .ONSET_DATE , SymptomsDto .ONSET_SYMPTOM ))
44
- + LayoutUtil .fluidRow (
45
- LayoutUtil .fluidColumn (9 , 0 ,
44
+ + LayoutUtil .fluidRowCss ( CssStyles . VSPACE3 ,
45
+ LayoutUtil .fluidColumn (8 , 0 ,
46
46
LayoutUtil .div (I18nProperties .getFieldCaption ("Symptoms.hint" ))),
47
- LayoutUtil .fluidColumn (3 , 0 ,
48
- LayoutUtil .locCss (CssStyles .VSPACE3 , BUTTONS_LOC )))
47
+ LayoutUtil .fluidColumn (4 , 0 ,
48
+ LayoutUtil .locCss (CssStyles .ALIGN_RIGHT , BUTTONS_LOC )))
49
49
+ LayoutUtil .fluidRow (
50
50
LayoutUtil .fluidColumn (6 , 0 ,
51
51
LayoutUtil .locsCss (CssStyles .VSPACE3 ,
@@ -185,22 +185,22 @@ public void buttonClick(ClickEvent event) {
185
185
}
186
186
});
187
187
188
- Button setAllToNoButton = new Button ("Set all to No" );
189
- setAllToNoButton .addStyleName (ValoTheme .BUTTON_LINK );
188
+ Button setEmptyToNoButton = new Button ("Set cleared to No" );
189
+ setEmptyToNoButton .addStyleName (ValoTheme .BUTTON_LINK );
190
190
191
- setAllToNoButton .addClickListener (new ClickListener () {
191
+ setEmptyToNoButton .addClickListener (new ClickListener () {
192
192
@ SuppressWarnings ("unchecked" )
193
193
@ Override
194
194
public void buttonClick (ClickEvent event ) {
195
195
for (Object symptomId : unconditionalSymptomFieldIds ) {
196
196
Field <SymptomState > symptom = (Field <SymptomState >) getFieldGroup ().getField (symptomId );
197
- if (symptom .isVisible ()) {
197
+ if (symptom .isVisible () && symptom . getValue () == null ) {
198
198
symptom .setValue (SymptomState .NO );
199
199
}
200
200
}
201
201
for (Object symptomId : conditionalBleedingSymptomFieldIds ) {
202
202
Field <SymptomState > symptom = (Field <SymptomState >) getFieldGroup ().getField (symptomId );
203
- if (symptom .isVisible ()) {
203
+ if (symptom .isVisible () && symptom . getValue () == null ) {
204
204
symptom .setValue (SymptomState .NO );
205
205
}
206
206
}
@@ -209,7 +209,7 @@ public void buttonClick(ClickEvent event) {
209
209
210
210
HorizontalLayout buttonsLayout = new HorizontalLayout ();
211
211
buttonsLayout .addComponent (clearAllButton );
212
- buttonsLayout .addComponent (setAllToNoButton );
212
+ buttonsLayout .addComponent (setEmptyToNoButton );
213
213
buttonsLayout .setDefaultComponentAlignment (Alignment .MIDDLE_RIGHT );
214
214
getContent ().addComponent (buttonsLayout , BUTTONS_LOC );
215
215
}
0 commit comments