Search in sources :

Example 11 with FieldGroup

use of com.vaadin.v7.data.fieldgroup.FieldGroup in project SORMAS-Project by hzi-braunschweig.

the class EventDataForm method setTypeOfPlaceTextRequirement.

public void setTypeOfPlaceTextRequirement() {
    FieldGroup fieldGroup = getFieldGroup();
    ComboBox typeOfPlaceField = (ComboBox) fieldGroup.getField(EventDto.TYPE_OF_PLACE);
    typeOfPlaceField.setImmediate(true);
    TextField typeOfPlaceTextField = (TextField) fieldGroup.getField(EventDto.TYPE_OF_PLACE_TEXT);
    typeOfPlaceTextField.setRequired(typeOfPlaceField.getValue() == TypeOfPlace.OTHER);
    typeOfPlaceField.addValueChangeListener(event -> typeOfPlaceTextField.setRequired(typeOfPlaceField.getValue() == TypeOfPlace.OTHER));
}
Also used : FieldGroup(com.vaadin.v7.data.fieldgroup.FieldGroup) ComboBox(com.vaadin.v7.ui.ComboBox) TextField(com.vaadin.v7.ui.TextField)

Aggregations

FieldGroup (com.vaadin.v7.data.fieldgroup.FieldGroup)7 Field (com.vaadin.v7.ui.Field)7 AbstractField (com.vaadin.v7.ui.AbstractField)5 ArrayList (java.util.ArrayList)4 Button (com.vaadin.ui.Button)3 Component (com.vaadin.ui.Component)3 HorizontalLayout (com.vaadin.ui.HorizontalLayout)3 Panel (com.vaadin.ui.Panel)3 Buffered (com.vaadin.v7.data.Buffered)3 AbstractLegacyComponent (com.vaadin.v7.ui.AbstractLegacyComponent)3 Arrays (java.util.Arrays)3 Collection (java.util.Collection)3 Notifier (com.vaadin.event.Action.Notifier)2 KeyCode (com.vaadin.event.ShortcutAction.KeyCode)2 Page (com.vaadin.server.Page)2 Alignment (com.vaadin.ui.Alignment)2 ClickEvent (com.vaadin.ui.Button.ClickEvent)2 ClickListener (com.vaadin.ui.Button.ClickListener)2 Notification (com.vaadin.ui.Notification)2 Type (com.vaadin.ui.Notification.Type)2