commit 699de23baf084a2f9a8d09a53561c78150692cfa
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Wed Feb 7 14:38:45 2018 +0100

    ref #7195 consistently displaying blocking registrations in list view and registration working set editor:
      - RegistrationWorkingSetService method to load blocking registrations
      - using ShowDetailsEvent to request presenters to show blocking registrations
      - adapting layout

diff --git a/src/main/java/eu/etaxonomy/cdm/service/IRegistrationWorkingSetService.java b/src/main/java/eu/etaxonomy/cdm/service/IRegistrationWorkingSetService.java
index 76d6504f..e13da028 100644
--- a/src/main/java/eu/etaxonomy/cdm/service/IRegistrationWorkingSetService.java
+++ b/src/main/java/eu/etaxonomy/cdm/service/IRegistrationWorkingSetService.java
@@ -9,6 +9,7 @@
 package eu.etaxonomy.cdm.service;
 
 import java.util.Collection;
+import java.util.Set;
 
 import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.model.common.User;
@@ -42,4 +43,6 @@ public interface IRegistrationWorkingSetService {
      */
     public RegistrationWorkingSet loadWorkingSetByReferenceID(Integer referenceID) throws RegistrationValidationException;
 
+    public Set<RegistrationDTO> loadBlockingRegistrations(Integer blockedRegistrationId);
+
 }
diff --git a/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java b/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java
index 73f76e29..90244225 100644
--- a/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java
+++ b/src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkingSetService.java
@@ -53,7 +53,7 @@ import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationValidationException
 public class RegistrationWorkingSetService implements IRegistrationWorkingSetService {
 
     public static final List<String> REGISTRATION_INIT_STRATEGY = Arrays.asList(new String []{
-            "blockedBy.typeDesignations",
+            "blockedBy",
             // typeDesignation
             "typeDesignations.typeStatus",
             "typeDesignations.typifiedNames.typeDesignations", // important !!
@@ -98,6 +98,29 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
           "derivationEvents.derivatives" // important, otherwise the DerivedUnits are not included into the graph of initialized entities!!!
   });
 
+  public static final List<String> BLOCKING_REGISTRATION_INIT_STRATEGY = Arrays.asList(new String []{
+
+          "blockedBy.blockedBy",
+          // typeDesignation
+          "blockedBy.typeDesignations.typeStatus",
+//          "typeDesignations.typifiedNames.typeDesignations", // important !!
+//          "typeDesignations.typeSpecimen",
+//          "typeDesignations.typeName.$",
+//          "typeDesignations.citation",
+//          "typeDesignations.citation.authorship.$",
+          // name
+//          "blockedBy.name.$",
+          "blockedBy.name.nomenclaturalReference.authorship",
+          "blockedBy.name.nomenclaturalReference.inReference",
+          "blockedBy.name.rank",
+//          "name.homotypicalGroup.typifiedNames",
+//          "name.status.type",
+//          "name.typeDesignations",
+          // institution
+          "blockedBy.institution",
+          }
+  );
+
     /**
      *
      */
@@ -167,6 +190,19 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
         return new RegistrationWorkingSet(makeDTOs(pager.getRecords()));
     }
 
+    @Override
+    public Set<RegistrationDTO> loadBlockingRegistrations(Integer blockedRegistrationId){
+
+        Registration registration = repo.getRegistrationService().load(blockedRegistrationId, BLOCKING_REGISTRATION_INIT_STRATEGY);
+        Set<Registration> registrations = registration.getBlockedBy();
+
+        Set<RegistrationDTO> blockingSet = new HashSet<>();
+        for(Registration reg : registrations){
+            blockingSet.add(new RegistrationDTO(reg));
+        }
+        return blockingSet;
+    }
+
     /**
      * @param regs
      * @return
@@ -179,6 +215,7 @@ public class RegistrationWorkingSetService implements IRegistrationWorkingSetSer
     }
 
 
+
     /**
      * @param regs
      */
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java b/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java
index 584f5ff3..b87130fc 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java
@@ -12,6 +12,7 @@ import static eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles.
 
 import java.util.Collection;
 import java.util.EnumSet;
+import java.util.Set;
 
 import org.joda.time.DateTime;
 import org.joda.time.format.ISODateTimeFormat;
@@ -76,8 +77,6 @@ public class RegistrationItem extends GridLayout {
 
     private RegistrationDTO regDto;
 
-    private boolean showBlockingRelations = false;
-
     private TimePeriodFormatter timePeriodFormatter = new TimePeriodFormatter(DateTimeFormat.ISO8601_DATE);
 
     // --------------------------------------------------
@@ -193,10 +192,6 @@ public class RegistrationItem extends GridLayout {
             setComponentError(new UserError("Citation is missing"));
         }
 
-        if(showBlockingRelations){
-            createBlockingRelationsContent();
-        }
-
         updateUI(regDto.getBibliographicCitationString(), regDto.getCreated(), regDto.getDatePublished(), regDto.getMessages().size(),
                 navigationEvent, null, regDto, regDto.getSubmitterUserName());
     }
@@ -225,14 +220,6 @@ public class RegistrationItem extends GridLayout {
                 referenceEditorAction, FontAwesome.EDIT, null, submitterName);
     }
 
-    private void createBlockingRelationsContent(){
-
-        if(blockingRelationsPanel == null && !regDto.getBlockedBy().isEmpty()){
-            blockingRelationsPanel = new RegistrationItemsPanel(parentView, "blocked by", regDto.getBlockedBy());
-            addComponent(blockingRelationsPanel, 0, 4, GRID_COLS - 1, 4);
-        }
-
-    }
 
     /**
      * @param submitterUserName TODO
@@ -269,7 +256,7 @@ public class RegistrationItem extends GridLayout {
             getMessageButton().setCaptionAsHtml(true);
         }
 
-        if(regDto != null && !regDto.isBlocked()){
+        if(regDto != null && regDto.isBlocked()){
             getBlockedByButton().setEnabled(true);
             getBlockedByButton().addStyleName("blocked");
         }
@@ -333,6 +320,30 @@ public class RegistrationItem extends GridLayout {
         }
     }
 
+    public int getRegistrationId(){
+        return regDto.getId();
+    }
+
+    /**
+     * @param showBlockingRelations the showBlockingRelations to set
+     */
+    public void showBlockingRegistrations(Set<RegistrationDTO> blockingRegDTOs) {
+
+        if(blockingRelationsPanel == null) {
+
+            if(regDto.isBlocked() && blockingRegDTOs.isEmpty()){
+                throw new RuntimeException("Registration is blocked but tet of blocking registrations is empty");
+            }
+            if(!regDto.isBlocked() && !blockingRegDTOs.isEmpty()){
+                throw new RuntimeException("No point showing blocking registrations for an unblocked registration");
+            }
+
+            blockingRelationsPanel = new RegistrationItemsPanel(parentView, "blocked by", blockingRegDTOs);
+            addComponent(blockingRelationsPanel, 0, 4, GRID_COLS - 1, 4);
+        }
+
+    }
+
     /* ====== RegistrationItemDesign Getters ====== */
     /**
      * @return the typeStateLabel
@@ -409,20 +420,9 @@ public class RegistrationItem extends GridLayout {
      * @return the showBlockingRelations
      */
     public boolean isShowBlockingRelations() {
-        return showBlockingRelations;
+        return blockingRelationsPanel != null;
     }
 
-    /**
-     * @param showBlockingRelations the showBlockingRelations to set
-     */
-    public void setShowBlockingRelations(boolean showBlockingRelations) {
-        if(showBlockingRelations && !this.showBlockingRelations){
-            createBlockingRelationsContent();
-        }
-        this.showBlockingRelations = showBlockingRelations;
-    }
-
-
 
    /* --------------------------------------- */
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/event/ShowDetailsEvent.java b/src/main/java/eu/etaxonomy/cdm/vaadin/event/ShowDetailsEvent.java
index 2289818f..5082f47e 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/event/ShowDetailsEvent.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/event/ShowDetailsEvent.java
@@ -31,12 +31,12 @@ public class ShowDetailsEvent<T extends Object, I extends Object> {
 
     /**
      *
-     * @param e
+     * @param sourceEvent
      * @param identifier
      * @param property
      */
-    public ShowDetailsEvent(Event e, Class<T> entityType , I identifier, String property) {
-        this.source = e;
+    public ShowDetailsEvent(Event sourceEvent, Class<T> entityType , I identifier, String property) {
+        this.source = sourceEvent;
         this.entityType = entityType;
         this.identifier = identifier;
         this.property = property;
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListPresenter.java
index 21d6d7d3..e9cd7c3e 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListPresenter.java
@@ -9,6 +9,7 @@
 package eu.etaxonomy.cdm.vaadin.view.registration;
 
 import java.util.EnumSet;
+import java.util.Set;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +26,7 @@ import eu.etaxonomy.cdm.model.name.RegistrationStatus;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.service.IRegistrationWorkingSetService;
 import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory;
+import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItem;
 import eu.etaxonomy.cdm.vaadin.event.EntityChangeEvent;
 import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent;
 import eu.etaxonomy.cdm.vaadin.event.UpdateResultsEvent;
@@ -131,16 +133,27 @@ public class ListPresenter extends AbstractPresenter<ListView> {
     }
 
     @EventBusListenerMethod
-    public void onShowDetailsEvent(ShowDetailsEvent<?,?> event) {
-
-        if(event.getEntityType().equals(RegistrationDTO.class)){
-            RegistrationDTO regDto = getWorkingSetService().loadDtoById((Integer)event.getIdentifier());
-            if(event.getProperty().equals("messages")){
-                if(getView() != null){
-                    getView().openDetailsPopup("Messages", regDto.getMessages());
-                }
-            }
+    public void onShowDetailsEvent(ShowDetailsEvent<RegistrationDTO, Integer> event) {
+
+        // FIXME check from own view!!!
+        if(getView() == null){
+            return;
         }
+
+        Integer registrationId = event.getIdentifier();
+
+        RegistrationDTO regDto = getWorkingSetService().loadDtoById(registrationId);
+        if(event.getProperty().equals("messages")){
+
+            getView().openDetailsPopup("Messages", regDto.getMessages());
+
+        } else if(event.getProperty().equals("blockedBy")){
+
+            Set<RegistrationDTO> blockingRegs = getWorkingSetService().loadBlockingRegistrations(registrationId);
+            RegistrationItem regItem = getView().getRegistrationItem(registrationId);
+            regItem.showBlockingRegistrations(blockingRegs);
+        }
+
     }
 
     @EventBusListenerMethod
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListView.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListView.java
index c118d295..af211d6f 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListView.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListView.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.ListSelect;
 import com.vaadin.ui.TextField;
 
 import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItem;
 import eu.etaxonomy.vaadin.mvp.ApplicationView;
 
 /**
@@ -73,5 +74,7 @@ public interface ListView extends ApplicationView<ListPresenter>{
      */
     Mode getViewMode();
 
+    public RegistrationItem getRegistrationItem(int registrationId);
+
 
 }
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListViewBean.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListViewBean.java
index 21d3702a..8e4c3f71 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListViewBean.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListViewBean.java
@@ -23,6 +23,7 @@ import com.vaadin.navigator.View;
 import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
 import com.vaadin.server.Page;
 import com.vaadin.spring.annotation.SpringView;
+import com.vaadin.ui.Component;
 import com.vaadin.ui.CssLayout;
 import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.ui.Label;
@@ -31,9 +32,11 @@ import com.vaadin.ui.Notification;
 import com.vaadin.ui.TextField;
 
 import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.model.name.Registration;
 import eu.etaxonomy.cdm.model.name.RegistrationStatus;
 import eu.etaxonomy.cdm.vaadin.component.TextFieldNFix;
 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItem;
+import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent;
 import eu.etaxonomy.cdm.vaadin.event.UpdateResultsEvent;
 import eu.etaxonomy.cdm.vaadin.security.AccessRestrictedView;
 import eu.etaxonomy.cdm.vaadin.security.UserHelper;
@@ -157,7 +160,12 @@ public class ListViewBean extends AbstractPageView<ListPresenter> implements Lis
             RegistrationItem item = new RegistrationItem(regDto, this);
             item.getSubmitterLabel().setVisible(isCurator);
             item.setWidth(100, Unit.PERCENTAGE);
-            item.getBlockedByButton().addClickListener(e -> item.setShowBlockingRelations(true));
+            item.getBlockedByButton().addClickListener(e -> getViewEventBus().publish(
+                    this,
+                    new ShowDetailsEvent<Registration, Integer>(
+                            e, Registration.class, regDto.getId(), "blockedBy"
+                            )
+                    ));
             listContainer.addComponent(item);
         }
     }
@@ -266,6 +274,17 @@ public class ListViewBean extends AbstractPageView<ListPresenter> implements Lis
         return viewMode;
     }
 
+    public RegistrationItem getRegistrationItem(int registrationId){
+        for(Component c : listContainer){
+            RegistrationItem item = (RegistrationItem)c;
+            if(registrationId == item.getRegistrationId()){
+                return item;
+            }
+
+        }
+        return null;
+    }
+
 
 
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
index c9da1c77..62990d57 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
@@ -58,7 +58,7 @@ public class RegistrationDTO{
 
     private List<String> messages = new ArrayList<>();
 
-    private Set<RegistrationDTO> blockedBy;
+    private Set<TypedEntityReference<Registration>> blockedBy;
 
 
     /**
@@ -366,13 +366,13 @@ public class RegistrationDTO{
     /**
      * @return the blockedBy
      */
-    public Set<RegistrationDTO> getBlockedBy() {
+    public Set<TypedEntityReference<Registration>> getBlockedBy() {
 
         if(blockedBy == null){
             blockedBy = new HashSet<>();
             if(reg.getBlockedBy() != null){
                 for(Registration blockReg : reg.getBlockedBy()){
-                    blockedBy.add(new RegistrationDTO(blockReg));
+                    blockedBy.add(new TypedEntityReference<Registration>(Registration.class, blockReg.getId(), blockReg.getIdentifier()));
                 }
             }
         }
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java
index c5550933..69f53c9d 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java
@@ -12,6 +12,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.EnumSet;
 import java.util.List;
+import java.util.Set;
 import java.util.Stack;
 import java.util.UUID;
 
@@ -604,6 +605,24 @@ public class RegistrationWorkingsetPresenter extends AbstractPresenter<Registrat
                 refreshView(true);
             }
         }
+    }
+
+    @EventBusListenerMethod
+    public void onShowDetailsEvent(ShowDetailsEvent<RegistrationDTO, Integer> event) {
+
+        // FIXME check from own view!!!
+        if(getView() == null){
+            return;
+        }
+
+        Integer registrationId = event.getIdentifier();
+
+        RegistrationDTO regDto = getWorkingSetService().loadDtoById(registrationId);
+        if(event.getProperty().equals("blockedBy")){
+
+            Set<RegistrationDTO> blockingRegs = getWorkingSetService().loadBlockingRegistrations(registrationId);
+            getView().setBlockingRegistrations(registrationId, blockingRegs);
+        }
 
     }
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java
index 1341ea76..fbcf96b7 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetView.java
@@ -9,6 +9,7 @@
 package eu.etaxonomy.cdm.vaadin.view.registration;
 
 import java.util.List;
+import java.util.Set;
 import java.util.UUID;
 
 import org.vaadin.viritin.fields.LazyComboBox;
@@ -61,6 +62,7 @@ public interface RegistrationWorkingsetView extends ApplicationView{
      */
     void setWorkingset(RegistrationWorkingSet workingset);
 
+    @Deprecated // no longer needed
     void addBlockingRegistration(RegistrationDTO blocking);
 
     /**
@@ -87,6 +89,12 @@ public interface RegistrationWorkingsetView extends ApplicationView{
      */
     void chooseNewTypeRegistrationWorkingset(Integer registrationEntityId);
 
+    /**
+     * @param registrationId
+     * @param blockingRegDTOs
+     */
+    void setBlockingRegistrations(int registrationId, Set<RegistrationDTO> blockingRegDTOs);
+
 
 
 
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java
index 849e3dfb..2b661bac 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java
@@ -11,7 +11,11 @@ package eu.etaxonomy.cdm.vaadin.view.registration;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.Stack;
 import java.util.UUID;
 
@@ -25,8 +29,6 @@ import com.vaadin.server.Page;
 import com.vaadin.spring.annotation.SpringView;
 import com.vaadin.ui.Alignment;
 import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
 import com.vaadin.ui.CssLayout;
 import com.vaadin.ui.GridLayout;
 import com.vaadin.ui.HorizontalLayout;
@@ -72,6 +74,34 @@ import eu.etaxonomy.vaadin.event.EditorActionType;
 public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWorkingsetPresenter>
     implements RegistrationWorkingsetView, View, AccessRestrictedView {
 
+    private class RegistrationDetailsItem {
+
+        RegistrationItemEditButtonGroup registrationItemEditButtonGroup;
+        CssLayout itemFooter;
+
+        public RegistrationDetailsItem(RegistrationItemEditButtonGroup registrationItemEditButtonGroup, CssLayout itemFooter){
+            this.registrationItemEditButtonGroup = registrationItemEditButtonGroup;
+            this.itemFooter = itemFooter;
+        }
+
+
+    }
+
+    /**
+     *
+     */
+    private static final int COL_INDEX_STATE_LABEL = 0;
+
+    /**
+     *
+     */
+    private static final int COL_INDEX_REG_ITEM = 1;
+
+    /**
+     *
+     */
+    private static final int COL_INDEX_BUTTON_GROUP = 2;
+
     public static final String DOM_ID_WORKINGSET = "workingset";
 
     private static final long serialVersionUID = -213040114015958970L;
@@ -99,6 +129,8 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
 
     private Panel registrationListPanel;
 
+    private Map<Integer, RegistrationDetailsItem> registrationItemMap = new HashMap<>();
+
     public RegistrationWorksetViewBean() {
         super();
     }
@@ -151,10 +183,28 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
 
     }
 
+    @Override
+    public void setBlockingRegistrations(int registrationId, Set<RegistrationDTO> blockingRegDTOs) {
+
+        RegistrationDetailsItem regItem = registrationItemMap.get(registrationId);
+
+        boolean blockingRegAdded = false;
+        for(Iterator it = regItem.itemFooter.iterator(); it.hasNext(); ){
+            if(it.next() instanceof RegistrationItemsPanel){
+                blockingRegAdded = true;
+                break;
+            }
+        }
+        if(!blockingRegAdded){
+            regItem.itemFooter.addComponent(new RegistrationItemsPanel(this, "Blocked by", blockingRegDTOs));
+        }
+    }
+
     /**
      * {@inheritDoc}
      */
     @Override
+    @Deprecated // no longer needed
     public void addBlockingRegistration(RegistrationDTO blocking) {
         if(registrations == null) {
             throw new RuntimeException("A Workingset must be present prior adding blocking registrations.");
@@ -177,9 +227,11 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
         //registrationsGrid.setColumnExpandRatio(0, 0.1f);
         registrationsGrid.setColumnExpandRatio(1, 1f);
 
+        registrationItemMap.clear();
+        registrationsGrid.setRows(workingset.getRegistrationDTOs().size() * 2  + 2);
         int row = 0;
         for(RegistrationDTO dto : workingset.getRegistrationDTOs()) {
-            putRegistrationListComponent(registrationsGrid, row++, dto);
+            row = putRegistrationListComponent(row, dto);
         }
 
         Label addRegistrationLabel_1 = new Label("Add a new registration for a");
@@ -207,7 +259,9 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
 //        buttonContainer.setWidth(100, Unit.PERCENTAGE);
         buttonContainer.setComponentAlignment(addRegistrationLabel_1, Alignment.MIDDLE_LEFT);
         buttonContainer.setComponentAlignment(addRegistrationLabel_2, Alignment.MIDDLE_LEFT);
-        registrationsGrid.addComponent(buttonContainer, 0, row, 2, row);
+
+        row++;
+        registrationsGrid.addComponent(buttonContainer, 0, row, COL_INDEX_BUTTON_GROUP, row);
         registrationsGrid.setComponentAlignment(buttonContainer, Alignment.MIDDLE_RIGHT);
 
         Panel namesTypesPanel = new Panel(registrationsGrid);
@@ -215,17 +269,16 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
     }
 
 
-    /**
-     * @param grid
-     * @param row If null, the new row will be inserted as last registration item, that is before the button row.
-     * @param dto
-     */
-    protected void putRegistrationListComponent(GridLayout grid, int row, RegistrationDTO dto) {
 
-        grid.setRows(grid.getRows() + 1);
+    protected int putRegistrationListComponent(int row, RegistrationDTO dto) {
 
         RegistrationItemEditButtonGroup regItemButtonGroup = new RegistrationItemEditButtonGroup(dto);
         Integer registrationEntityID = dto.getId();
+        CssLayout footer = new CssLayout();
+        footer.setWidth(100, Unit.PERCENTAGE);
+        footer.setStyleName("item-footer");
+        RegistrationDetailsItem regDetailsItem = new RegistrationDetailsItem(regItemButtonGroup, footer);
+        registrationItemMap.put(registrationEntityID, regDetailsItem);
         Stack<EditorActionContext> context = new Stack<EditorActionContext>();
         context.push(new EditorActionContext(
                     new TypedEntityReference<>(Registration.class, registrationEntityID),
@@ -276,18 +329,15 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
         if(!dto.isBlocked()){
             blockingRegistrationButton.setEnabled(false);
         } else {
-            blockingRegistrationButton.addClickListener(new ClickListener() {
-
-                private static final long serialVersionUID = 2846082434479085292L;
-                RegistrationItemsPanel blockedByPanel = null;
-                @Override
-                public void buttonClick(ClickEvent event) {
-                    if(blockedByPanel == null){
-                        blockedByPanel = new RegistrationItemsPanel(RegistrationWorksetViewBean.this, "Blocked by", dto.getBlockedBy());
-                        regItemButtonGroup.addComponent(blockedByPanel);
-                    }
-                }
-            });
+            blockingRegistrationButton.addClickListener(e -> getViewEventBus().publish(
+                    this,
+                    new ShowDetailsEvent<RegistrationDTO, Integer>(
+                            e,
+                            RegistrationDTO.class,
+                            dto.getId(),
+                            "blockedBy"
+                            )
+                    ));
         }
         buttonGroup.addComponent(blockingRegistrationButton);
 
@@ -329,11 +379,17 @@ public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWo
         PermissionDebugUtils.addGainPerEntityPermissionButton(buttonGroup, Registration.class, dto.getId(),
                 EnumSet.of(CRUD.UPDATE), RegistrationStatus.PREPARATION.name());
 
-        grid.addComponent(stateLabel, 0, row);
-        grid.setComponentAlignment(stateLabel, Alignment.TOP_LEFT);
-        grid.addComponent(regItemButtonGroup, 1, row);
-        grid.addComponent(buttonGroup, 2, row);
-        grid.setComponentAlignment(buttonGroup, Alignment.TOP_LEFT);
+        row++;
+        registrationsGrid.addComponent(stateLabel, COL_INDEX_STATE_LABEL, row);
+        registrationsGrid.setComponentAlignment(stateLabel, Alignment.TOP_LEFT);
+        registrationsGrid.addComponent(regItemButtonGroup, COL_INDEX_REG_ITEM, row);
+        registrationsGrid.addComponent(buttonGroup, COL_INDEX_BUTTON_GROUP, row);
+        registrationsGrid.setComponentAlignment(buttonGroup, Alignment.TOP_LEFT);
+
+        row++;
+        registrationsGrid.addComponent(footer, 0, row, COL_INDEX_BUTTON_GROUP, row);
+
+        return row;
     }
 
     /**
diff --git a/src/main/webapp/VAADIN/themes/edit-valo/edit-valo.scss b/src/main/webapp/VAADIN/themes/edit-valo/edit-valo.scss
index 60c858e0..caa8d688 100644
--- a/src/main/webapp/VAADIN/themes/edit-valo/edit-valo.scss
+++ b/src/main/webapp/VAADIN/themes/edit-valo/edit-valo.scss
@@ -259,10 +259,11 @@ $status-ready-color: adjust-color($plain-red, $hue: 180deg);
                 margin-top: round($v-unit-size / 2);
             }
         
-            .registration-list {
-                .v-gridlayout-slot {
-                    border-bottom: valo-border($border: $v-border, $color: $v-background-color, $strength: 1.4);
-                }
+            .v-panel-content {
+                padding: 0 round($v-unit-size/3);
+            }
+            .registration-list .item-footer {
+                border-bottom: valo-border($border: $v-border, $color: $v-background-color, $strength: 1.4);
             }
     }
 
