Project

General

Profile

« Previous | Next » 

Revision 538800b4

Added by Andreas Kohlbecker almost 7 years ago

ref #6169 first implementation of delete operations

View differences:

src/main/java/eu/etaxonomy/vaadin/component/ToOneRelatedEntityCombobox.java
25 25
 * @since May 24, 2017
26 26
 *
27 27
 */
28
public class ToOneRelatedEntityCombobox<V extends Object> extends CompositeCustomField<V> implements ToOneRelatedEntityField {
28
public class ToOneRelatedEntityCombobox<V extends Object> extends CompositeCustomField<V> implements ToOneRelatedEntityField<V> {
29 29

  
30 30
    private static final long serialVersionUID = 6277565876657520311L;
31 31

  
......
42 42

  
43 43
    public ToOneRelatedEntityCombobox(String caption, Class<V> type){
44 44
        this.type = type;
45
        setCaption(caption);
45 46
        lazySelect = new LazyComboBox<V>(type);
46 47
        addStyledComponents(lazySelect, addButton, editButton);
47 48
        addSizedComponents(lazySelect, container);
49
        lazySelect.addValueChangeListener(e -> {
50
            // update the itemContainer immediately so that the edit button acts on the chosen item
51
            lazySelect.commit();
52
        });
48 53
    }
49 54

  
50 55

  
......
114 119
        editButton.addClickListener(listener);
115 120
    }
116 121

  
122
    @Override
123
    public void selectNewItem(V bean){
124
        lazySelect.refresh();
125
        lazySelect.setValue(bean);
126
        lazySelect.markAsDirty();
127
    }
128

  
117 129
}

Also available in: Unified diff