HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2013-07-15 2cb025e2a39beabfa3919777ba8ec2399af5674b
preselect pac if select contains single item
1 files modified
10 ■■■■■ changed files
hsarweb/src/de/hsadmin/web/vaadin/PacPrefixedNamePropertyFieldFactory.java 10 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/vaadin/PacPrefixedNamePropertyFieldFactory.java
@@ -39,10 +39,18 @@
        sel.setNullSelectionAllowed(false);
        sel.setNewItemsAllowed(prop.newItemsAllowed());
        Map<String, String> selectValues = prop.getSelectValues();
        for (Object key : selectValues.keySet()) {
        if (selectValues.size() == 1) {
            String key = selectValues.keySet().iterator().next();
            sel.addItem(key);
            sel.setItemCaption(key, selectValues.get(key));
            sel.select(key);
        } else {
            for (Object key : selectValues.keySet()) {
                sel.addItem(key);
                sel.setItemCaption(key, selectValues.get(key));
            }
        }
        sel.setWidth(80.0f, Sizeable.UNITS_PIXELS);
        sel.setInvalidAllowed(prop.newItemsAllowed());
        layout.addComponent(sel);