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 2018/03/06 12:26:46 UTC
[isis] 02/02: ISIS-1888: copies over TypeOfFacet for an empty pojo
list,
so that actions returning empty collections render with the correct CSS.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git
commit fb83729fd1f7271623d6e3177bde086a7bbf0c91
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Mar 5 18:20:09 2018 +0000
ISIS-1888: copies over TypeOfFacet for an empty pojo list, so that actions returning empty collections render with the correct CSS.
---
.../wicket/ui/actionresponse/ActionResultResponseType.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponseType.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponseType.java
index 15182d5..6afe499 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponseType.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponseType.java
@@ -31,8 +31,11 @@ import org.apache.isis.applib.value.Clob;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
+import org.apache.isis.core.metamodel.facets.actcoll.typeof.ElementSpecificationProviderFromTypeOfFacet;
+import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.runtime.system.context.IsisContext;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
import org.apache.isis.viewer.wicket.model.models.ActionModel;
import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
@@ -60,6 +63,14 @@ public enum ActionResultResponseType {
COLLECTION {
@Override
public ActionResultResponse interpretResult(final ActionModel actionModel, final AjaxRequestTarget target, final ObjectAdapter resultAdapter) {
+ if(resultAdapter.getElementSpecification() == null) {
+ final TypeOfFacet typeOfFacet = actionModel.getActionMemento().getAction(IsisContext.getSessionFactory().getSpecificationLoader()).getFacet(
+ TypeOfFacet.class);
+ if (typeOfFacet != null) {
+ resultAdapter.setElementSpecificationProvider(new ElementSpecificationProviderFromTypeOfFacet(typeOfFacet.valueSpec()));
+ }
+ }
+
final EntityCollectionModel collectionModel = EntityCollectionModel.createStandalone(resultAdapter, actionModel.getIsisSessionFactory());
// take a copy of the actionModel, because the original can get mutated (specifically: its arguments cleared)
final ActionModel actionModelCopy = actionModel.copy();
--
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.