You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/05/08 09:13:49 UTC

[03/10] git commit: ISIS-764: reference panel simplification

ISIS-764: reference panel simplification

... compact component uses EntityLinkSimplePanel rather than EntityLinkSelect2Panel (since simply need to render a link).


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/867a26ee
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/867a26ee
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/867a26ee

Branch: refs/heads/ISIS-764
Commit: 867a26eee6f90ffb6bb2abce61f08388981dab3a
Parents: a785bfd
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue May 6 23:24:02 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue May 6 23:24:02 2014 +0100

----------------------------------------------------------------------
 .../ui/components/scalars/reference/ReferencePanel.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/867a26ee/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
index 262441f..8909687 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java
@@ -34,6 +34,7 @@ import org.apache.isis.viewer.wicket.model.models.EntityModel;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.ui.ComponentType;
 import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelAbstract;
+import org.apache.isis.viewer.wicket.ui.components.widgets.entitysimplelink.EntityLinkSimplePanel;
 import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
 
 /**
@@ -50,6 +51,7 @@ public class ReferencePanel extends ScalarPanelAbstract {
     private static final String ID_SCALAR_IF_COMPACT = "scalarIfCompact";
 
     private EntityLinkSelect2Panel entityLink;
+    private EntityLinkSimplePanel entitySimpleLink;
 
     public ReferencePanel(final String id, final ScalarModel scalarModel) {
         super(id, scalarModel);
@@ -163,13 +165,13 @@ public class ReferencePanel extends ScalarPanelAbstract {
         final ScalarModel scalarModel = getModel();
         final String name = scalarModel.getName();
         
-        entityLink = new EntityLinkSelect2Panel(ComponentType.ENTITY_LINK.getWicketId(), getModel());
+        entitySimpleLink = (EntityLinkSimplePanel) getComponentFactoryRegistry().createComponent(ComponentType.ENTITY_LINK, getModel());
         
-        entityLink.setOutputMarkupId(true);
-        entityLink.setLabel(Model.of(name));
+        entitySimpleLink.setOutputMarkupId(true);
+        entitySimpleLink.setLabel(Model.of(name));
         
-        final FormComponentLabel labelIfCompact = new FormComponentLabel(ID_SCALAR_IF_COMPACT, entityLink);
-        labelIfCompact.add(entityLink);
+        final FormComponentLabel labelIfCompact = new FormComponentLabel(ID_SCALAR_IF_COMPACT, entitySimpleLink);
+        labelIfCompact.add(entitySimpleLink);
         
         addOrReplace(labelIfCompact);