Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Fixes SORMAS-Foundation#3348 null value in create Event Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
syntakker committed Nov 2, 2020
1 parent e5bb6ee commit a26a58c
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static de.symeda.sormas.ui.utils.LayoutUtil.locs;

import com.vaadin.v7.ui.ComboBox;
import com.vaadin.v7.ui.Field;
import com.vaadin.v7.ui.Label;
import com.vaadin.v7.ui.RichTextArea;
import com.vaadin.v7.ui.TextField;
Expand Down Expand Up @@ -162,18 +161,16 @@ private void updateByCreating() {
}

private void updateByActionContext() {
NullableOptionGroup field = (NullableOptionGroup) getFieldGroup().getField(ActionDto.ACTION_CONTEXT);
ActionContext actionContext = (ActionContext) field.getNullableValue();
Object fieldValueActionContext = getFieldGroup().getField(ActionDto.ACTION_CONTEXT).getValue();
ActionContext actionContext = fieldValueActionContext == null ? null : (ActionContext) fieldValueActionContext;

// context reference depending on action context
// ready for adding new context
ComboBox eventField = (ComboBox) getFieldGroup().getField(ActionDto.EVENT);
if (actionContext != null) {
switch (actionContext) {
case EVENT:
if (actionContext == ActionContext.EVENT) {
FieldHelper.setFirstVisibleClearOthers(eventField);
FieldHelper.setFirstRequired(eventField);
break;
}
} else {
FieldHelper.setFirstVisibleClearOthers(null, eventField);
Expand Down

0 comments on commit a26a58c

Please sign in to comment.