Example usage for com.vaadin.v7.ui AbstractSelect getValue

List of usage examples for com.vaadin.v7.ui AbstractSelect getValue

Introduction

In this page you can find the example usage for com.vaadin.v7.ui AbstractSelect getValue.

Prototype

@Override
public Object getValue() 

Source Link

Document

Gets the selected item id or in multiselect mode a set of selected ids.

Usage

From source file:de.symeda.sormas.ui.person.PersonEditForm.java

License:Open Source License

private void fillDeathAndBurialFields(AbstractSelect deathPlaceType, TextField deathPlaceDesc,
        TextField burialPlaceDesc) {
    if (deathPlaceType.isVisible() && deathPlaceType.getValue() == null) {
        deathPlaceType.setValue(DeathPlaceType.OTHER);
        if (deathPlaceDesc.isVisible()
                && (deathPlaceDesc.getValue() == null || deathPlaceDesc.getValue().isEmpty())) {
            deathPlaceDesc.setValue(getValue().getAddress().toString());
        }/*ww  w .  j  av a2 s. c om*/
    }

    if (burialPlaceDesc.isVisible()
            && (burialPlaceDesc.getValue() == null || deathPlaceDesc.getValue().isEmpty())) {
        burialPlaceDesc.setValue(getValue().getAddress().toString());
    }
}

From source file:de.symeda.sormas.ui.utils.FieldHelper.java

License:Open Source License

public static void updateItems(AbstractSelect select, List<?> items) {
    Object value = select.getValue();
    boolean readOnly = select.isReadOnly();
    select.setReadOnly(false);//from  w ww .ja v a2  s  .c  o  m
    select.removeAllItems();
    if (items != null) {
        select.addItems(items);
    }
    select.setValue(value);
    select.setReadOnly(readOnly);
}