Project

General

Profile

Revision 86f09e7b

ID86f09e7b2e34f272b2f4769f5f7fb3729fea7ef7
Parent 27820075
Child 97c6b732

Added by Andreas Kohlbecker about 1 year ago

fix #8184 using NativeSelect instead of ListSelect to avoid circumvent a bug in the ListSelect which affects the Chrome browser

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/common/FilterableAnnotationsField.java
25 25
import com.vaadin.ui.CssLayout;
26 26
import com.vaadin.ui.DefaultFieldFactory;
27 27
import com.vaadin.ui.Field;
28
import com.vaadin.ui.ListSelect;
28
import com.vaadin.ui.NativeSelect;
29 29
import com.vaadin.ui.Table;
30 30
import com.vaadin.ui.Table.ColumnHeaderMode;
31 31
import com.vaadin.ui.TextArea;
......
109 109
                    ta.setWidth(100,  Unit.PERCENTAGE);
110 110
                    field = ta;
111 111
                } else if(propertyId.equals("annotationType")) {
112
                    ListSelect select = new ListSelect();
112
                    NativeSelect select = new NativeSelect();
113 113
                    select.setContainerDataSource(typeSelectItemContainer);
114 114
                    select.setWidth(100, Unit.PIXELS);
115
                    select.setRows(1);
116 115
                    field = select;
117 116
                }
118 117
                field.setStyleName(table.getStyleName());
src/main/java/eu/etaxonomy/cdm/vaadin/component/common/GeoLocationField.java
25 25
import com.vaadin.ui.CssLayout;
26 26
import com.vaadin.ui.GridLayout;
27 27
import com.vaadin.ui.Label;
28
import com.vaadin.ui.ListSelect;
28
import com.vaadin.ui.NativeSelect;
29 29
import com.vaadin.ui.TextField;
30 30

  
31 31
import eu.etaxonomy.cdm.model.location.Point;
......
54 54
    private TextField latitudeField = new LongLatField("Latitude", Axis.LATITUDE);
55 55
    private Label longLatParsed = new Label();
56 56
    private TextField errorRadiusField = new TextFieldNFix("Error radius (m)");
57
    private ListSelect referenceSystemSelect;
57
    private NativeSelect referenceSystemSelect;
58 58

  
59 59
    private LMap map = new LMap();
60 60
    private LMarker mapMarker = new LMarker();
......
109 109

  
110 110
        errorRadiusField.addValueChangeListener( e -> updateMap());
111 111

  
112
        referenceSystemSelect = new ListSelect("Reference system");
112
        referenceSystemSelect = new NativeSelect("Reference system");
113 113
        referenceSystemSelect.setNullSelectionAllowed(false);
114
        referenceSystemSelect.setRows(1);
115 114
        referenceSystemSelect.setWidth(100, Unit.PERCENTAGE);
116 115

  
117 116
        GridLayout root = new GridLayout();
......
224 223
        return fieldGroup;
225 224
    }
226 225

  
227
    public ListSelect getReferenceSystemSelect() {
226
    public NativeSelect getReferenceSystemSelect() {
228 227
        return referenceSystemSelect;
229 228
    }
230 229

  
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationStatusSelect.java
11 11
import java.util.Collection;
12 12

  
13 13
import com.vaadin.data.Container;
14
import com.vaadin.ui.ListSelect;
14
import com.vaadin.ui.NativeSelect;
15 15

  
16 16
import eu.etaxonomy.cdm.model.name.RegistrationStatus;
17 17

  
......
20 20
 * @since Jul 4, 2018
21 21
 *
22 22
 */
23
public class RegistrationStatusSelect extends ListSelect {
23
public class RegistrationStatusSelect extends NativeSelect {
24 24

  
25 25

  
26 26
    private static final long serialVersionUID = 2400974680207121417L;
......
63 63
     */
64 64
    public void init() {
65 65
        addStyleName("registration-status");
66
        setRows(1);
67 66
        setWidth("110px");
68 67

  
69 68
        addValueChangeListener(e -> updateStyles());
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NameTypeDesignationEditorView.java
8 8
*/
9 9
package eu.etaxonomy.cdm.vaadin.view.name;
10 10

  
11
import com.vaadin.ui.ListSelect;
11
import com.vaadin.ui.NativeSelect;
12 12

  
13 13
import eu.etaxonomy.cdm.model.name.TaxonName;
14 14
import eu.etaxonomy.cdm.model.reference.Reference;
......
26 26

  
27 27
    ToOneRelatedEntityCombobox<Reference> getCitationCombobox();
28 28

  
29
    ListSelect getTypeStatusSelect();
29
    NativeSelect getTypeStatusSelect();
30 30

  
31 31
    ToManyRelatedEntitiesComboboxSelect<TaxonName> getTypifiedNamesComboboxSelect();
32 32

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NameTypeDesignationPopupEditor.java
14 14
import com.vaadin.ui.Alignment;
15 15
import com.vaadin.ui.CheckBox;
16 16
import com.vaadin.ui.GridLayout;
17
import com.vaadin.ui.ListSelect;
17
import com.vaadin.ui.NativeSelect;
18 18
import com.vaadin.ui.TextField;
19 19

  
20 20
import eu.etaxonomy.cdm.model.common.AnnotationType;
......
52 52

  
53 53
    private ToManyRelatedEntitiesComboboxSelect<TaxonName> typifiedNamesComboboxSelect;
54 54

  
55
    private ListSelect typeStatusSelect;
55
    private NativeSelect typeStatusSelect;
56 56

  
57 57
    private ToOneRelatedEntityCombobox<Reference> citationCombobox;
58 58

  
......
135 135
            row++;
136 136
        }
137 137

  
138
        typeStatusSelect = new ListSelect("Type status");
138
        typeStatusSelect = new NativeSelect("Type status");
139 139
        typeStatusSelect.setNullSelectionAllowed(false);
140
        typeStatusSelect.setRows(1);
141 140
        typeStatusSelect.setWidth(100, Unit.PERCENTAGE);
142 141
        addField(typeStatusSelect, "typeStatus", 0, row, 1, row);
143 142
        grid.setComponentAlignment(typeStatusSelect, Alignment.TOP_RIGHT);
......
205 204
     * @return the typeStatusSelect
206 205
     */
207 206
    @Override
208
    public ListSelect getTypeStatusSelect() {
207
    public NativeSelect getTypeStatusSelect() {
209 208
        return typeStatusSelect;
210 209
    }
211 210

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationDTORow.java
13 13

  
14 14
import com.vaadin.server.Sizeable.Unit;
15 15
import com.vaadin.ui.Component;
16
import com.vaadin.ui.ListSelect;
16
import com.vaadin.ui.NativeSelect;
17 17
import com.vaadin.ui.TextField;
18 18

  
19 19
import eu.etaxonomy.cdm.model.common.DefinedTerm;
......
45 45
     */
46 46
    TextField associatedTypeDesignationCount = new TextField();
47 47
    RowListSelect kindOfUnit = new RowListSelect(); // position is IMPORTANT, see rowListSelectColumn()
48
    ListSelect typeStatus = new ListSelect();
48
    NativeSelect typeStatus = new NativeSelect();
49 49
    ToOneRelatedEntityCombobox<eu.etaxonomy.cdm.model.occurrence.Collection> collection =
50 50
            new ToOneRelatedEntityCombobox<eu.etaxonomy.cdm.model.occurrence.Collection>(null, eu.etaxonomy.cdm.model.occurrence.Collection.class);
51 51
    TextField accessionNumber = new TextFieldNFix();
......
58 58
    private ToOneRelatedEntityButtonUpdater<Collection> collectionFieldUpdater;
59 59

  
60 60
    public SpecimenTypeDesignationDTORow(){
61
        kindOfUnit.setRows(1);
61

  
62 62
        kindOfUnit.setRequired(true);
63 63
        kindOfUnit.setRow(this);
64
        typeStatus.setRows(1);
65 64
        typeStatus.setRequired(true);
66 65

  
67 66
        accessionNumber.setWidth(100, Unit.PIXELS);
......
136 135
        return 0;
137 136
    }
138 137

  
139
    class RowListSelect extends ListSelect implements CollectionRowRepresentative {
138
    class RowListSelect extends NativeSelect implements CollectionRowRepresentative {
140 139

  
141 140
        private static final long serialVersionUID = 3235653923633494213L;
142 141

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditor.java
22 22
import com.vaadin.ui.AbstractSelect.ItemCaptionMode;
23 23
import com.vaadin.ui.Component;
24 24
import com.vaadin.ui.GridLayout;
25
import com.vaadin.ui.ListSelect;
25
import com.vaadin.ui.NativeSelect;
26 26
import com.vaadin.ui.Panel;
27 27
import com.vaadin.ui.TextArea;
28 28

  
......
74 74

  
75 75
    private static final long serialVersionUID = 5418275817834009509L;
76 76

  
77
    private ListSelect countrySelectField;
77
    private NativeSelect countrySelectField;
78 78

  
79 79
    private ElementCollectionField<SpecimenTypeDesignationDTO> typeDesignationsCollectionField;
80 80

  
......
96 96
     * @return the countrySelectField
97 97
     */
98 98
    @Override
99
    public ListSelect getCountrySelectField() {
99
    public NativeSelect getCountrySelectField() {
100 100
        return countrySelectField;
101 101
    }
102 102

  
......
117 117
        // FieldUnit + GatheringEvent
118 118

  
119 119
        int row = 0;
120
        countrySelectField = new ListSelect("Country");
120
        countrySelectField = new NativeSelect("Country");
121 121
        addField(countrySelectField, "country", 1, row , 2, row);
122 122
        countrySelectField.setWidth("100%");
123 123
        countrySelectField.setItemCaptionMode(ItemCaptionMode.PROPERTY);
124 124
        countrySelectField.setItemCaptionPropertyId("label");
125
        countrySelectField.setRows(1);
126 125

  
127 126
        row++;
128 127
        TextArea localityField = new TextArea("Locality");
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetPopupEditorView.java
11 11
import org.vaadin.viritin.fields.ElementCollectionField;
12 12

  
13 13
import com.vaadin.ui.Component;
14
import com.vaadin.ui.ListSelect;
14
import com.vaadin.ui.NativeSelect;
15 15

  
16 16
import eu.etaxonomy.cdm.vaadin.component.common.GeoLocationField;
17 17
import eu.etaxonomy.cdm.vaadin.component.common.TeamOrPersonField;
......
27 27
public interface SpecimenTypeDesignationWorkingsetPopupEditorView extends ApplicationView<SpecimenTypeDesignationWorkingsetEditorPresenter>,
28 28
    AnnotationsEditor {
29 29

  
30
    public ListSelect getCountrySelectField();
30
    public NativeSelect getCountrySelectField();
31 31

  
32 32
    ElementCollectionField<SpecimenTypeDesignationDTO> getTypeDesignationsCollectionField();
33 33

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
24 24
import com.vaadin.ui.Alignment;
25 25
import com.vaadin.ui.CheckBox;
26 26
import com.vaadin.ui.GridLayout;
27
import com.vaadin.ui.ListSelect;
27
import com.vaadin.ui.NativeSelect;
28 28
import com.vaadin.ui.TextField;
29 29

  
30 30
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
......
110 110

  
111 111
    private CheckBox orthographicVariantToggle;
112 112

  
113
    private ListSelect rankSelect;
113
    private NativeSelect rankSelect;
114 114

  
115 115
    private TeamOrPersonField combinationAuthorshipField;
116 116

  
......
271 271

  
272 272
        int row = 0;
273 273

  
274
        rankSelect = new ListSelect("Rank");
274
        rankSelect = new NativeSelect("Rank");
275 275
        rankSelect.setNullSelectionAllowed(false);
276
        rankSelect.setRows(1);
277 276
        rankSelect.setWidth(100, Unit.PERCENTAGE);
278 277
        addField(rankSelect, "rank", 0, row, 1, row);
279 278
        grid.setComponentAlignment(rankSelect, Alignment.TOP_RIGHT);
......
888 887
     * {@inheritDoc}
889 888
     */
890 889
    @Override
891
    public ListSelect getRankSelect() {
890
    public NativeSelect getRankSelect() {
892 891
        return rankSelect;
893 892
    }
894 893

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditorView.java
12 12

  
13 13
import com.vaadin.ui.AbstractField;
14 14
import com.vaadin.ui.CheckBox;
15
import com.vaadin.ui.ListSelect;
15
import com.vaadin.ui.NativeSelect;
16 16

  
17 17
import eu.etaxonomy.cdm.model.name.TaxonName;
18 18
import eu.etaxonomy.cdm.model.reference.Reference;
......
40 40
     */
41 41
    public ToManyRelatedEntitiesComboboxSelect<TaxonName> getBasionymComboboxSelect();
42 42

  
43
    public ListSelect getRankSelect();
43
    public NativeSelect getRankSelect();
44 44

  
45 45
    /**
46 46
     * @return the exBasionymAuthorshipField
src/main/java/eu/etaxonomy/cdm/vaadin/view/reference/ReferencePopupEditor.java
24 24
import com.vaadin.ui.Component;
25 25
import com.vaadin.ui.Field;
26 26
import com.vaadin.ui.GridLayout;
27
import com.vaadin.ui.ListSelect;
27
import com.vaadin.ui.NativeSelect;
28 28
import com.vaadin.ui.TextField;
29 29

  
30 30
import eu.etaxonomy.cdm.api.utility.RoleProber;
......
73 73

  
74 74
    private final static int GRID_ROWS = 14;
75 75

  
76
    private ListSelect typeSelect;
76
    private NativeSelect typeSelect;
77 77

  
78 78
    private ToOneRelatedEntityCombobox<Reference> inReferenceCombobox;
79 79

  
......
152 152
        int row = 0;
153 153
        datePublishedField = new VerbatimTimePeriodField("Date published");
154 154
        addField(datePublishedField, "datePublished", 0, row, 1, row);
155
        typeSelect = new ListSelect("Reference type");
155
        typeSelect = new NativeSelect("Reference type");
156 156
        typeSelect.addItems(referenceTypes);
157 157
        typeSelect.setNullSelectionAllowed(false);
158
        typeSelect.setRows(1);
158

  
159 159
        typeSelect.addValueChangeListener(e -> updateFieldVisibility((ReferenceType)e.getProperty().getValue()));
160 160
        addField(typeSelect, "type", GRID_COLS - 1, row);
161 161
        grid.setComponentAlignment(typeSelect, Alignment.TOP_RIGHT);
......
460 460
    }
461 461

  
462 462
    @Override
463
    public ListSelect getTypeSelect() {
463
    public NativeSelect getTypeSelect() {
464 464
        return typeSelect;
465 465
    }
466 466

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/reference/ReferencePopupEditorView.java
8 8
*/
9 9
package eu.etaxonomy.cdm.vaadin.view.reference;
10 10

  
11
import com.vaadin.ui.ListSelect;
11
import com.vaadin.ui.NativeSelect;
12 12

  
13 13
import eu.etaxonomy.cdm.model.agent.Institution;
14 14
import eu.etaxonomy.cdm.model.reference.Reference;
......
24 24
 */
25 25
public interface ReferencePopupEditorView extends ApplicationView<ReferenceEditorPresenter> {
26 26

  
27
    public ListSelect getTypeSelect();
27
    public NativeSelect getTypeSelect();
28 28

  
29 29
    public ToOneRelatedEntityCombobox<Reference> getInReferenceCombobox();
30 30

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListView.java
12 12
import java.util.UUID;
13 13

  
14 14
import com.vaadin.ui.AbstractSelect;
15
import com.vaadin.ui.ListSelect;
15
import com.vaadin.ui.NativeSelect;
16 16
import com.vaadin.ui.TextField;
17 17

  
18 18
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO;
......
60 60
    /**
61 61
     * @return the statusFilter
62 62
     */
63
    public ListSelect getRegistrationStatusFilter();
63
    public NativeSelect getRegistrationStatusFilter();
64 64

  
65 65
    /**
66 66
     * @return the submitterFilter
67 67
     */
68
    public ListSelect getSubmitterFilter();
68
    public NativeSelect getSubmitterFilter();
69 69

  
70 70
    /**
71 71
     * @param optionInProgress
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListViewBean.java
31 31
import com.vaadin.ui.HorizontalLayout;
32 32
import com.vaadin.ui.Label;
33 33
import com.vaadin.ui.ListSelect;
34
import com.vaadin.ui.NativeSelect;
34 35
import com.vaadin.ui.Notification;
35 36
import com.vaadin.ui.TextField;
36 37
import com.vaadin.ui.VerticalLayout;
......
75 76

  
76 77
    private Label filterInstructionLabel = new Label("Filter the registrations by");
77 78

  
78
    private ListSelect registrationStatusFilter = null;
79
    private NativeSelect registrationStatusFilter = null;
79 80

  
80
    private ListSelect submitterFilter = null; // must be null, the presenter relies on this
81
    private NativeSelect submitterFilter = null; // must be null, the presenter relies on this
81 82

  
82 83
    private TextField identifierFilter = new TextFieldNFix("Identifier");
83 84

  
......
104 105
        boolean userIsCurator = UserHelperAccess.userHelper().userIs(new RoleProber(RolesAndPermissions.ROLE_CURATION));
105 106
        boolean userIsAdmin = UserHelperAccess.userHelper().userIsAdmin();
106 107
        if(userIsCurator || userIsAdmin){
107
            submitterFilter = new ListSelect("Submitter");
108
            submitterFilter.setRows(1);
108
            submitterFilter = new NativeSelect("Submitter");
109 109
            submitterFilter.addValueChangeListener(e -> updateResults(null, null));
110 110
            toolBar.addComponent(submitterFilter);
111 111
        }
112 112

  
113 113
        if(viewMode.equals(Mode.all)){
114
            registrationStatusFilter = new ListSelect("Registration status", Arrays.asList(RegistrationStatus.values()));
114
            registrationStatusFilter = new NativeSelect("Registration status", Arrays.asList(RegistrationStatus.values()));
115 115
            registrationStatusFilter.setNullSelectionAllowed(true);
116
            registrationStatusFilter.setRows(1);
117 116
            registrationStatusFilter.addValueChangeListener(e -> updateResults(null, null));
118 117
            toolBar.addComponent(registrationStatusFilter);
119 118
        }
120 119

  
121
        statusTypeFilter = new ListSelect("Type Status");
120
        statusTypeFilter = new NativeSelect("Type Status");
122 121
        ((ListSelect)statusTypeFilter).setRows(3);
123 122
        statusTypeFilter.setMultiSelect(true);
124 123
        statusTypeFilter.setNullSelectionAllowed(true);
......
298 297
     * @return the registrationStatusFilter
299 298
     */
300 299
    @Override
301
    public ListSelect getRegistrationStatusFilter() {
300
    public NativeSelect getRegistrationStatusFilter() {
302 301
        return registrationStatusFilter;
303 302
    }
304 303

  
......
306 305
     * @return the submitterFilter
307 306
     */
308 307
    @Override
309
    public ListSelect getSubmitterFilter() {
308
    public NativeSelect getSubmitterFilter() {
310 309
        return submitterFilter;
311 310
    }
312 311

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationPopEditorView.java
9 9
package eu.etaxonomy.cdm.vaadin.view.registration;
10 10

  
11 11
import com.vaadin.ui.DateField;
12
import com.vaadin.ui.ListSelect;
12
import com.vaadin.ui.NativeSelect;
13 13

  
14 14
import eu.etaxonomy.vaadin.mvp.ApplicationView;
15 15

  
......
24 24
    /**
25 25
     * @return the submitterField
26 26
     */
27
    public ListSelect getSubmitterField();
27
    public NativeSelect getSubmitterField();
28 28

  
29 29
    /**
30 30
     * @return the institutionField
31 31
     */
32
    public ListSelect getInstitutionField();
32
    public NativeSelect getInstitutionField();
33 33

  
34 34
    /**
35 35
     * @return
36 36
     */
37
    public ListSelect getStatusSelect();
37
    public NativeSelect getStatusSelect();
38 38

  
39 39
    /**
40 40
     * @return
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationPopupEditor.java
15 15
import com.vaadin.spring.annotation.SpringComponent;
16 16
import com.vaadin.ui.DateField;
17 17
import com.vaadin.ui.FormLayout;
18
import com.vaadin.ui.ListSelect;
18
import com.vaadin.ui.NativeSelect;
19 19
import com.vaadin.ui.TextField;
20 20

  
21 21
import eu.etaxonomy.cdm.model.name.Registration;
......
40 40

  
41 41
    TextField specificIdentifierField;
42 42

  
43
    private ListSelect submitterField;
43
    private NativeSelect submitterField;
44 44

  
45
    private ListSelect institutionField;
45
    private NativeSelect institutionField;
46 46

  
47
    private ListSelect statusSelect;
47
    private NativeSelect statusSelect;
48 48

  
49 49
    private DateField registrationDateField;
50 50

  
......
68 68
        specificIdentifierField = new TextFieldNFix("Specific Identifier");
69 69
        addField(specificIdentifierField, "specificIdentifier");
70 70

  
71
        statusSelect = new ListSelect("Status", Arrays.asList(RegistrationStatus.values()));
71
        statusSelect = new NativeSelect("Status", Arrays.asList(RegistrationStatus.values()));
72 72
        statusSelect.setNullSelectionAllowed(false);
73
        statusSelect.setRows(1);
74 73
        addField(statusSelect, "status");
75 74

  
76
        submitterField = new ListSelect("Submitter");
75
        submitterField = new NativeSelect("Submitter");
77 76
        submitterField.setEnabled(false);
78 77
        submitterField.setWidth(100, Unit.PERCENTAGE);
79 78
        addField(submitterField, "submitter");
80 79

  
81
        institutionField = new ListSelect("Institution");
80
        institutionField = new NativeSelect("Institution");
82 81
        institutionField.setEnabled(false);
83 82
        institutionField.setWidth(100, Unit.PERCENTAGE);
84 83
        addField(institutionField, "institution");
......
123 122
     * @return the submitterField
124 123
     */
125 124
    @Override
126
    public ListSelect getSubmitterField() {
125
    public NativeSelect getSubmitterField() {
127 126
        return submitterField;
128 127
    }
129 128

  
......
131 130
     * @return the institutionField
132 131
     */
133 132
    @Override
134
    public ListSelect getInstitutionField() {
133
    public NativeSelect getInstitutionField() {
135 134
        return institutionField;
136 135
    }
137 136

  
138 137
    @Override
139
    public ListSelect getStatusSelect() {
138
    public NativeSelect getStatusSelect() {
140 139
        return statusSelect;
141 140
    }
142 141

  
src/test/java/eu/etaxonomy/vaadin/mvp/CdmEditorPresenterTest.java
16 16
import org.unitils.spring.annotation.SpringBeanByType;
17 17
import org.vaadin.spring.events.EventBus.ViewEventBus;
18 18

  
19
import com.vaadin.ui.ListSelect;
19
import com.vaadin.ui.NativeSelect;
20 20

  
21 21
import eu.etaxonomy.cdm.api.application.CdmRepository;
22 22
import eu.etaxonomy.cdm.model.agent.Institution;
......
64 64
         * {@inheritDoc}
65 65
         */
66 66
        @Override
67
        public ListSelect getTypeSelect() {
67
        public NativeSelect getTypeSelect() {
68 68
            return null;
69 69
        }
70 70

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)