ISIS-993: now rendering properties and collections in tabs ok. Some stuff still to do: - provide a far-right column that is not tabbed at all. - better handling of column spans, to adjust if spans don't sum to 12 correctly. - layout views don't render. - allow layout views be edited and, perhaps, shared via settings. - hints should be extended
Project: http://git-wip-us.apache.org/repos/asf/isis/repo Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/131f1879 Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/131f1879 Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/131f1879 Branch: refs/heads/ISIS-993 Commit: 131f1879d99e641c9d14c3ad79d071f1a4dfaa0e Parents: c5de434 Author: Dan Haywood <d...@haywood-associates.co.uk> Authored: Fri Jan 8 18:05:54 2016 +0000 Committer: Dan Haywood <d...@haywood-associates.co.uk> Committed: Mon Jan 25 15:06:07 2016 +0000 ---------------------------------------------------------------------- .../layout/v1_0/CollectionLayoutMetadata.java | 15 ++++ .../services/layout/Object_viewLayout.java | 1 + .../ObjectLayoutMetadataServiceDefault.java | 21 +++--- .../viewer/wicket/model/models/EntityModel.java | 22 ++++-- .../collections/EntityCollectionsPanel.java | 63 ++++++++++++++--- .../entity/properties/EntityPropertiesForm.java | 74 ++++++++++++++------ .../properties/EntityPropertiesPanel.html | 3 + .../entity/tabgroups/EntityTabGroupsPanel.java | 2 +- .../dom/simple/SimpleObject.layout.xml | 17 ++--- 9 files changed, 162 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayoutMetadata.java ---------------------------------------------------------------------- diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayoutMetadata.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayoutMetadata.java index 4dc14cd..7aa17f6 100644 --- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayoutMetadata.java +++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayoutMetadata.java @@ -27,6 +27,8 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; +import com.google.common.base.Function; + import org.apache.isis.applib.annotation.Where; /** @@ -223,4 +225,17 @@ public class CollectionLayoutMetadata implements ColumnContent, ActionHolder, Se this.metadataError = metadataError; } + + public static class Functions { + private Functions(){} + + public static Function<CollectionLayoutMetadata, String> id() { + return new Function<CollectionLayoutMetadata, String>() { + @Override + public String apply(final CollectionLayoutMetadata metadata) { + return metadata.getId(); + } + }; + } + } } http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/applib/src/main/java/org/apache/isis/applib/services/layout/Object_viewLayout.java ---------------------------------------------------------------------- diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/layout/Object_viewLayout.java b/core/applib/src/main/java/org/apache/isis/applib/services/layout/Object_viewLayout.java index 4957e9c..82d574c 100644 --- a/core/applib/src/main/java/org/apache/isis/applib/services/layout/Object_viewLayout.java +++ b/core/applib/src/main/java/org/apache/isis/applib/services/layout/Object_viewLayout.java @@ -54,6 +54,7 @@ public class Object_viewLayout { return getObjectLayoutMetadata(); } + @Programmatic // TODO ... excluded for now (getting an Isis framework exception in the view model rendering). public boolean hide$$() { return getObjectLayoutMetadata() == null; } http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/layout/ObjectLayoutMetadataServiceDefault.java ---------------------------------------------------------------------- diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/layout/ObjectLayoutMetadataServiceDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/layout/ObjectLayoutMetadataServiceDefault.java index 294531a..972999d 100644 --- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/layout/ObjectLayoutMetadataServiceDefault.java +++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/layout/ObjectLayoutMetadataServiceDefault.java @@ -254,7 +254,9 @@ public class ObjectLayoutMetadataServiceDefault lastTabGroup.getTabs().add(tab); Column left = new Column(12); tab.setLeft(left); - left.getCollections().add(new CollectionLayoutMetadata(collectionId)); + final CollectionLayoutMetadata layoutMetadata = new CollectionLayoutMetadata(collectionId); + layoutMetadata.setDefaultView("table"); + left.getCollections().add(layoutMetadata); } } @@ -293,6 +295,7 @@ public class ObjectLayoutMetadataServiceDefault metadata.visit(new ObjectLayoutMetadata.VisitorAdapter() { private final Map<String, int[]> propertySequenceByGroup = Maps.newHashMap(); + private int collectionSequence = 1; private int actionDomainObjectSequence = 1; private int actionPropertyGroupSequence = 1; private int actionPropertySequence = 1; @@ -376,7 +379,7 @@ public class ObjectLayoutMetadataServiceDefault // @MemberOrder#name based on owning property group, @MemberOrder#sequence monotonically increasing final PropertyGroup propertyGroup = propertyLayoutMetadata.getOwner(); final String groupName = propertyGroup.getName(); - final String sequence = nextInSequenceFor(groupName); + final String sequence = nextInSequenceFor(groupName, propertySequenceByGroup); FacetUtil.addFacet( new MemberOrderFacetXml(groupName, sequence, translationService, oneToOneAssociation)); } @@ -398,7 +401,7 @@ public class ObjectLayoutMetadataServiceDefault // @MemberOrder#name based on the collection's id (so that each has a single "member group") final String groupName = collectionLayoutMetadata.getId(); - final String sequence = nextInSequenceFor(groupName); + final String sequence = "" + collectionSequence++; FacetUtil.addFacet( new MemberOrderFacetXml(groupName, sequence, translationService, oneToManyAssociation)); @@ -406,16 +409,18 @@ public class ObjectLayoutMetadataServiceDefault final Column column = collectionLayoutMetadata.getOwner(); final Tab tab = column.getOwner(); if(tab.getContents().size() == 1) { - tab.setName(collectionLayoutMetadata.getNamed()); + final String collectionName = oneToManyAssociation.getName(); + tab.setName(collectionName); } } - private String nextInSequenceFor(final String propertyGroupName) { - synchronized (propertySequenceByGroup) { - int[] holder = propertySequenceByGroup.get(propertyGroupName); + private String nextInSequenceFor( + final String key, final Map<String, int[]> seqByKey) { + synchronized (seqByKey) { + int[] holder = seqByKey.get(key); if(holder == null) { holder = new int[]{0}; - propertySequenceByGroup.put(propertyGroupName, holder); + seqByKey.put(key, holder); } holder[0]++; return ""+holder[0]; http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java index 899f48e..9838163 100644 --- a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java +++ b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java @@ -29,6 +29,7 @@ import org.apache.wicket.model.Model; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.isis.applib.annotation.BookmarkPolicy; +import org.apache.isis.applib.layout.v1_0.Column; import org.apache.isis.applib.layout.v1_0.Tab; import org.apache.isis.applib.services.memento.MementoService.Memento; import org.apache.isis.core.metamodel.adapter.ObjectAdapter; @@ -63,7 +64,6 @@ import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento; public class EntityModel extends BookmarkableModel<ObjectAdapter> { private static final long serialVersionUID = 1L; - // ////////////////////////////////////////////////////////// // factory methods for PageParameters @@ -91,7 +91,6 @@ public class EntityModel extends BookmarkableModel<ObjectAdapter> { return pageParameters; } - public enum RenderingHint { REGULAR, PROPERTY_COLUMN, @@ -634,7 +633,7 @@ public class EntityModel extends BookmarkableModel<ObjectAdapter> { // ////////////////////////////////////////////////////////// - // tab metadata (if any) + // tab and column metadata (if any) // ////////////////////////////////////////////////////////// private Tab tabMetadata; @@ -643,10 +642,25 @@ public class EntityModel extends BookmarkableModel<ObjectAdapter> { return tabMetadata; } - public void setTabMetadata(final Tab tabMetadata) { + public EntityModel withTabMetadata(final Tab tabMetadata) { this.tabMetadata = tabMetadata; + return this; } + + private Column columnMetadata; + + public EntityModel withColumnMetadata(final Column columnMetadata) { + this.columnMetadata = columnMetadata; + this.tabMetadata = columnMetadata.getOwner(); + return this; + } + + public Column getColumnMetadata() { + return columnMetadata; + } + + // ////////////////////////////////////////////////////////// // equals, hashCode // ////////////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java index b182b1f..81b83c4 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java @@ -19,23 +19,32 @@ package org.apache.isis.viewer.wicket.ui.components.entity.collections; +import java.util.Comparator; import java.util.List; + +import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; + import org.apache.wicket.behavior.AttributeAppender; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.repeater.RepeatingView; import org.apache.wicket.model.Model; + import org.apache.isis.applib.annotation.Where; import org.apache.isis.applib.filter.Filter; import org.apache.isis.applib.filter.Filters; +import org.apache.isis.applib.layout.v1_0.CollectionLayoutMetadata; +import org.apache.isis.applib.layout.v1_0.Column; import org.apache.isis.core.metamodel.adapter.ObjectAdapter; import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy; import org.apache.isis.core.metamodel.facets.all.named.NamedFacet; import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet; -import org.apache.isis.core.metamodel.spec.ObjectSpecification; +import org.apache.isis.core.metamodel.facets.members.order.MemberOrderFacet; import org.apache.isis.core.metamodel.spec.feature.Contributed; import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation; import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation; +import org.apache.isis.core.runtime.services.DeweyOrderComparator; import org.apache.isis.viewer.wicket.model.links.LinkAndLabel; import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel; import org.apache.isis.viewer.wicket.model.models.EntityModel; @@ -89,8 +98,34 @@ public class EntityCollectionsPanel extends PanelAbstract<EntityModel> { private void addCollections() { final EntityModel entityModel = getModel(); final ObjectAdapter adapter = entityModel.getObject(); - final ObjectSpecification noSpec = adapter.getSpecification(); - final List<ObjectAssociation> associations = visibleCollections(adapter, noSpec); + + final Column columnMetadataIfAny = entityModel.getColumnMetadata(); + final Filter<ObjectAssociation> filter; + if (columnMetadataIfAny != null) { + final ImmutableList<String> collectionIds = FluentIterable + .from(columnMetadataIfAny.getCollections()) + .transform(CollectionLayoutMetadata.Functions.id()) + .toList(); + filter = new Filter<ObjectAssociation>() { + @Override + public boolean accept(final ObjectAssociation objectAssociation) { + return collectionIds.contains(objectAssociation.getId()); + } + }; + } else { + filter = Filters.any(); + } + + final List<ObjectAssociation> associations = visibleCollections(adapter, filter); + associations.sort(new Comparator<ObjectAssociation>() { + private final DeweyOrderComparator deweyOrderComparator = new DeweyOrderComparator(); + @Override + public int compare(final ObjectAssociation o1, final ObjectAssociation o2) { + final MemberOrderFacet o1Facet = o1.getFacet(MemberOrderFacet.class); + final MemberOrderFacet o2Facet = o2.getFacet(MemberOrderFacet.class); + return deweyOrderComparator.compare(o1Facet.sequence(), o2Facet.sequence()); + } + }); final RepeatingView collectionRv = new RepeatingView(ID_COLLECTIONS); add(collectionRv); @@ -104,7 +139,8 @@ public class EntityCollectionsPanel extends PanelAbstract<EntityModel> { } } - private void addCollectionToForm(final EntityModel entityModel, + private void addCollectionToForm( + final EntityModel entityModel, final ObjectAssociation association, final WebMarkupContainer collectionRvContainer) { @@ -163,15 +199,22 @@ public class EntityCollectionsPanel extends PanelAbstract<EntityModel> { } - private List<ObjectAssociation> visibleCollections(final ObjectAdapter adapter, final ObjectSpecification noSpec) { - return noSpec.getAssociations(Contributed.INCLUDED, visibleCollectionsFilter(adapter)); + private static List<ObjectAssociation> visibleCollections( + final ObjectAdapter adapter, + final Filter<ObjectAssociation> filter) { + return adapter.getSpecification().getAssociations( + Contributed.INCLUDED, visibleCollectionsFilter(adapter, filter)); } @SuppressWarnings("unchecked") - private Filter<ObjectAssociation> visibleCollectionsFilter(final ObjectAdapter adapter) { - return Filters.and(ObjectAssociation.Filters.COLLECTIONS, ObjectAssociation.Filters.dynamicallyVisible(adapter, - InteractionInitiatedBy.USER, Where.PARENTED_TABLES - )); + private static Filter<ObjectAssociation> visibleCollectionsFilter( + final ObjectAdapter adapter, + final Filter<ObjectAssociation> filter) { + return Filters.and( + ObjectAssociation.Filters.COLLECTIONS, + ObjectAssociation.Filters.dynamicallyVisible( + adapter, InteractionInitiatedBy.USER, Where.PARENTED_TABLES), + filter); } } http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java index 225dcdd..adc9262 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java @@ -176,7 +176,8 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements boolean addedProperties; if(columnSpans.getLeft() > 0) { - addedProperties = addPropertiesInColumn(leftColumn, MemberGroupLayoutHint.LEFT, tabMetaDataIfAny, columnSpans); + addedProperties = addPropertiesAndCollections( + leftColumn, MemberGroupLayoutHint.LEFT, entityModel, tabMetaDataIfAny, columnSpans); addButtons(leftColumn); addFeedbackGui(leftColumn); } else { @@ -194,7 +195,8 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements if(columnSpans.getMiddle() > 0) { MarkupContainer middleColumn = new WebMarkupContainer(ID_MIDDLE_COLUMN); add(middleColumn); - addPropertiesInColumn(middleColumn, MemberGroupLayoutHint.MIDDLE, tabMetaDataIfAny, columnSpans); + addPropertiesAndCollections( + middleColumn, MemberGroupLayoutHint.MIDDLE, entityModel, tabMetaDataIfAny, columnSpans); } else { Components.permanentlyHide(this, ID_MIDDLE_COLUMN); } @@ -203,7 +205,8 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements if(columnSpans.getRight() > 0) { MarkupContainer rightColumn = new WebMarkupContainer(ID_RIGHT_COLUMN); add(rightColumn); - addPropertiesInColumn(rightColumn, MemberGroupLayoutHint.RIGHT, tabMetaDataIfAny, columnSpans); + addPropertiesAndCollections( + rightColumn, MemberGroupLayoutHint.RIGHT, entityModel, tabMetaDataIfAny, columnSpans); } else { Components.permanentlyHide(this, ID_RIGHT_COLUMN); } @@ -223,7 +226,9 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements collectionSpan = columnSpans.getCollections(); } - final Component collectionsColumn = getComponentFactoryRegistry().addOrReplaceComponent(this, idCollectionsToShow, ComponentType.ENTITY_COLLECTIONS, entityModel); + final Component collectionsColumn = + getComponentFactoryRegistry().addOrReplaceComponent( + this, idCollectionsToShow, ComponentType.ENTITY_COLLECTIONS, entityModel); addClassForSpan(collectionsColumn, collectionSpan); Components.permanentlyHide(this, idCollectionsToHide); @@ -233,20 +238,31 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements } } + private boolean addPropertiesAndCollections( + final MarkupContainer col, + final MemberGroupLayoutHint hint, + final EntityModel entityModel, + final Tab tabMetaDataIfAny, final ColumnSpans columnSpans) { + final boolean addedProperties; + addedProperties = addPropertiesInColumn(col, hint, entityModel, tabMetaDataIfAny, columnSpans); + addCollectionsIfRequired(col, hint, entityModel, tabMetaDataIfAny); + return addedProperties; + } + private boolean addPropertiesInColumn( final MarkupContainer markupContainer, final MemberGroupLayoutHint hint, + final EntityModel entityModel, final Tab tabMetaDataIfAny, final ColumnSpans columnSpans) { final int span = hint.from(columnSpans); - - final EntityModel entityModel = (EntityModel) getModel(); + final ObjectAdapter adapter = entityModel.getObject(); final ObjectSpecification objSpec = adapter.getSpecification(); final Column columnMetaDataIfAny = tabMetaDataIfAny != null ? hint.from(tabMetaDataIfAny) : null; - final List<ObjectAssociation> properties = visibleAssociations(adapter, ObjectAssociation.Filters.PROPERTIES); + final List<ObjectAssociation> properties = visibleProperties(adapter); final RepeatingView memberGroupRv = new RepeatingView(ID_MEMBER_GROUP); markupContainer.add(memberGroupRv); @@ -299,13 +315,23 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements addClassForSpan(markupContainer, span); - // if in a tab, then also render collections - if(columnMetaDataIfAny != null) { - final List<ObjectAssociation> collections = visibleAssociations(adapter, ObjectAssociation.Filters.COLLECTIONS); + return !groupNames.isEmpty(); + } - } + private void addCollectionsIfRequired( + final MarkupContainer column, + final MemberGroupLayoutHint hint, + final EntityModel entityModel, + final Tab tabMetaDataIfAny) { - return !groupNames.isEmpty(); + if(tabMetaDataIfAny != null) { + final Column columnMetadata = hint.from(tabMetaDataIfAny); + final EntityModel modelWithMetadata = new EntityModel(entityModel.getPageParameters()).withColumnMetadata(columnMetadata); + getComponentFactoryRegistry() + .addOrReplaceComponent(column, "collections", ComponentType.ENTITY_COLLECTIONS, modelWithMetadata); + } else { + Components.permanentlyHide(column, "collections"); + } } private void addPropertyToForm( @@ -329,24 +355,28 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements } } + private List<ObjectAssociation> visibleProperties(final ObjectAdapter adapter) { + return visibleProperties(adapter, Filters.<ObjectAssociation>any()); + } - private List<ObjectAssociation> visibleAssociations( + private List<ObjectAssociation> visibleProperties( final ObjectAdapter adapter, - final Filter<ObjectAssociation> associationFilter) { + final Filter<ObjectAssociation> filter) { final ObjectSpecification objSpec = adapter.getSpecification(); - return objSpec.getAssociations(Contributed.INCLUDED, visibleAssociationFilter(adapter, Where.OBJECT_FORMS, - associationFilter)); + return objSpec.getAssociations( + Contributed.INCLUDED, visiblePropertiesFilter(adapter, filter)); } @SuppressWarnings("unchecked") - private static Filter<ObjectAssociation> visibleAssociationFilter( + private static Filter<ObjectAssociation> visiblePropertiesFilter( final ObjectAdapter adapter, - final Where where, - final Filter<ObjectAssociation> associationFilter) { - return Filters.and(associationFilter, ObjectAssociation.Filters.dynamicallyVisible(adapter, - InteractionInitiatedBy.USER, where - )); + final Filter<ObjectAssociation> filter) { + return Filters.and( + ObjectAssociation.Filters.PROPERTIES, + ObjectAssociation.Filters.dynamicallyVisible( + adapter, InteractionInitiatedBy.USER, Where.OBJECT_FORMS), + filter); } @Override http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html index 4e917e2..ad8872a 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html @@ -42,6 +42,7 @@ </div> </fieldset> </div> + <div wicket:id="collections"></div> <div class="feedbackPanel"> <span wicket:id="feedback"></span> </div> @@ -70,6 +71,7 @@ </div> </fieldset> </div> + <div wicket:id="collections"></div> </div> <div wicket:id="rightColumn"> <div class="inputFormTable properties"> @@ -90,6 +92,7 @@ </div> </fieldset> </div> + <div wicket:id="collections"></div> </div> <div wicket:id="entityCollections"></div> </div> http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java index 6f49a68..fec95d0 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java @@ -121,7 +121,7 @@ public class EntityTabGroupsPanel extends PanelAbstract<EntityModel> { super(id); final EntityModel modelWithTabHints = new EntityModel(model.getPageParameters()); - modelWithTabHints.setTabMetadata(tab); + modelWithTabHints.withTabMetadata(tab); getComponentFactoryRegistry().addOrReplaceComponent(this, ID_ENTITY_PROPERTIES_AND_COLLECTIONS, ComponentType.ENTITY_PROPERTIES, modelWithTabHints); } http://git-wip-us.apache.org/repos/asf/isis/blob/131f1879/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml ---------------------------------------------------------------------- diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml index a50bdcf..c9e7ac8 100644 --- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml +++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml @@ -5,7 +5,7 @@ </actions> <tabGroup> <tab name="Common"> - <left span="4"> + <left span="6"> <propertyGroup name="General"> <property id="name" labelPosition="TOP"> <actions> @@ -14,11 +14,13 @@ </property> </propertyGroup> </left> - <middle span="4"> - </middle> + <right span="6"> + <collection id="similarTo" defaultView="table"/> + <collection id="others" defaultView="hide"/> + </right> </tab> <tab name="Metadata"> - <left span="4"> + <left span="6"> <propertyGroup name="Persistence"> <actions> <action id="downloadJdoMetadata"/> @@ -29,11 +31,4 @@ </left> </tab> </tabGroup> - <tabGroup> - <tab name="Similar To"> - <left span="12"> - <collection id="similarTo"/> - </left> - </tab> - </tabGroup> </objectLayout> \ No newline at end of file