restoring accidentally removed formatter code
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 8 Nov 2018 14:12:43 +0000 (15:12 +0100)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Thu, 8 Nov 2018 14:12:43 +0000 (15:12 +0100)
src/main/java/eu/etaxonomy/cdm/vaadin/event/EditorActionContextFormatter.java

index 8fa4d2ae3154373de146ae7b9b1570698e727a4b..adc0123a8d244b277d7efd7de9d365578178156b 100644 (file)
@@ -13,6 +13,8 @@ import java.util.Stack;
 
 import org.apache.commons.lang3.StringUtils;
 
+import com.vaadin.ui.Component;
+
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.ref.TypedEntityReference;
 import eu.etaxonomy.cdm.vaadin.event.EditorActionContextFormat.TargetInfoType;
@@ -72,6 +74,18 @@ public class EditorActionContextFormatter {
                     if (propertyIdPath != null) {
                         targetInfo = propertyIdPath.toString();
                     }
+                } else {
+                    // TargetInfoType.FIELD_CAPTION
+                    if(parentCtx.getTargetField() != null){
+                        Component captionComponent = parentCtx.getTargetField();
+                        while(captionComponent != null){
+                            targetInfo = captionComponent.getCaption();
+                            if(targetInfo != null){
+                                break;
+                            }
+                            captionComponent = captionComponent.getParent();
+                        }
+                    }
                 }
             }
         }