Project

General

Profile

Revision 90d7f315

ID90d7f31560645417f1218c504e41d15f48a11ae7
Parent 18754eca
Child 49d7537a

Added by Patrick Plitzner over 4 years ago

Fix label of selection box #5458

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java
5 5

  
6 6
import com.vaadin.annotations.AutoGenerated;
7 7
import com.vaadin.data.Container;
8
import com.vaadin.data.Item;
8 9
import com.vaadin.data.util.IndexedContainer;
9 10
import com.vaadin.event.ShortcutAction.KeyCode;
10 11
import com.vaadin.navigator.View;
......
85 86
	public void dataBinding(){
86 87
		List<TaxonNode> classificationList = distListener.getTaxonNodeList();
87 88
		List<TermVocabulary<DefinedTermBase>> namedAreaList = distListener.getNamedAreaList();
88
		Container c = new IndexedContainer(classificationList);
89
		Container c = new IndexedContainer();
90
		String propertyId = "label";
91
		c.addContainerProperty(propertyId, String.class, "[no taxon]");
92
		for (TaxonNode taxonNode : classificationList) {
93
			Item item = c.addItem(taxonNode);
94
			if(taxonNode.getTaxon()!=null){
95
				item.getItemProperty(propertyId).setValue(taxonNode.getTaxon().getName().getTitleCache());
96
			}
97
			else if(taxonNode.getClassification()!=null){
98
				item.getItemProperty(propertyId).setValue(taxonNode.getClassification().getName().getText());
99
			}
100
		}
101
		classificationBox.setItemCaptionPropertyId(propertyId);
89 102
		classificationBox.setContainerDataSource(c);
90 103
//		classificationSelection.setContainerDataSource(c);
91 104
		Container d = new IndexedContainer(namedAreaList);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)