Project

General

Profile

« Previous | Next » 

Revision 6702c7e1

Added by Andreas Kohlbecker almost 7 years ago

ref #6169 basic TaxonName popup editor

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/SelectFieldFactory.java
74 74
    }
75 75

  
76 76
    public <T extends CdmBase> ListSelect createListSelect(String caption, Class<T> type, List<OrderHint> orderHints){
77
        return createListSelect(caption, type, orderHints, null);
78
    }
79

  
80
    /**
81
     *
82
     * @param caption
83
     * @param type
84
     * @param orderHints
85
     * @param propertyId the property id from which to read the label
86
     * @return
87
     */
88
    public <T extends CdmBase> ListSelect createListSelect(String caption, Class<T> type, List<OrderHint> orderHints, String propertyId){
77 89

  
78 90
        if(orderHints == null){
79 91
            orderHints = OrderHint.defaultOrderHintsFor(type);
......
83 95
        ListSelect select = new ListSelect(caption, termItemContainer);
84 96

  
85 97
        // guess property id to use for display
86
        String propertyId = null;
87
        if(orderHints != null && !orderHints.isEmpty()){
88
            propertyId = orderHints.get(0).getPropertyName();
98
        if(propertyId == null) {
99
            if(orderHints != null && !orderHints.isEmpty()){
100
                propertyId = orderHints.get(0).getPropertyName();
101
            }
102
        }
103
        if(propertyId != null){
89 104
            select.setItemCaptionPropertyId(propertyId);
90 105
        }
91 106
        return select;

Also available in: Unified diff