From 73308c9b43d39d642e9bcc592493365741055e20 Mon Sep 17 00:00:00 2001
From: Patrick Plitzner
Date: Thu, 17 Mar 2016 18:13:43 +0100
Subject: [PATCH] empty taxon field when selecting name #5602
---
.../section/occurrence/DeterminationEventDetailElement.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java
index 9d9c4ab5e..adff08911 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java
@@ -133,6 +133,12 @@ public class DeterminationEventDetailElement extends
getEntity().setPreferredFlag(checkbox_preferredFlag.getSelection());
} else if (eventSource == selectionTaxonNameBase) {
getEntity().setTaxonName(selectionTaxonNameBase.getSelection());
+ //empty taxon field if name does not belong the taxon
+ TaxonBase taxonBase = selection_taxonBase.getEntity();
+ if(taxonBase!=null && taxonBase.getName()!=null
+ && !taxonBase.getName().equals(selectionTaxonNameBase.getSelection())){
+ selection_taxonBase.setEntity(null);
+ }
} else if (eventSource == selection_taxonBase) {
TaxonBase taxon = selection_taxonBase.getSelection();
getEntity().setTaxon(taxon);
--
2.34.1