From 6ed7ee38a4712431d3afb315bbde2eeae349472c Mon Sep 17 00:00:00 2001 From: Konstantin Krivopustov Date: Fri, 31 Mar 2017 18:34:29 +0400 Subject: [PATCH] PL-8764 Create CustomValueCollectionDatasource, CustomValueGroupDatasource, CustomValueHierarchicalDatasource (datasourceClass XML attribute) --- modules/gui/src/com/haulmont/cuba/gui/window.xsd | 3 +++ .../haulmont/cuba/gui/xml/data/DsContextLoader.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/gui/src/com/haulmont/cuba/gui/window.xsd b/modules/gui/src/com/haulmont/cuba/gui/window.xsd index 630ea93149..13b80e605f 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/window.xsd +++ b/modules/gui/src/com/haulmont/cuba/gui/window.xsd @@ -2324,6 +2324,7 @@ + @@ -2342,6 +2343,7 @@ + @@ -2361,6 +2363,7 @@ + diff --git a/modules/gui/src/com/haulmont/cuba/gui/xml/data/DsContextLoader.java b/modules/gui/src/com/haulmont/cuba/gui/xml/data/DsContextLoader.java index a95456a8b8..3f2714cd72 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/xml/data/DsContextLoader.java +++ b/modules/gui/src/com/haulmont/cuba/gui/xml/data/DsContextLoader.java @@ -464,7 +464,9 @@ public class DsContextLoader { String id = getDatasourceId(element); builder.reset().setMetaClass(metadata.getClassNN(KeyValueEntity.class)).setId(id); - ValueCollectionDatasourceImpl datasource = builder.buildValuesCollectionDatasource(); + ValueCollectionDatasourceImpl datasource = builder + .setDsClass(getDatasourceClass(element)) + .buildValuesCollectionDatasource(); String maxResults = element.attributeValue("maxResults"); if (!StringUtils.isEmpty(maxResults)) @@ -485,7 +487,9 @@ public class DsContextLoader { String id = getDatasourceId(element); builder.reset().setMetaClass(metadata.getClassNN(KeyValueEntity.class)).setId(id); - ValueGroupDatasourceImpl datasource = builder.buildValuesGroupDatasource(); + ValueGroupDatasourceImpl datasource = builder + .setDsClass(getDatasourceClass(element)) + .buildValuesGroupDatasource(); String maxResults = element.attributeValue("maxResults"); if (!StringUtils.isEmpty(maxResults)) @@ -506,7 +510,9 @@ public class DsContextLoader { String id = getDatasourceId(element); builder.reset().setMetaClass(metadata.getClassNN(KeyValueEntity.class)).setId(id); - ValueHierarchicalDatasourceImpl datasource = builder.buildValuesHierarchicalDatasource(); + ValueHierarchicalDatasourceImpl datasource = builder + .setDsClass(getDatasourceClass(element)) + .buildValuesHierarchicalDatasource(); String maxResults = element.attributeValue("maxResults"); if (!StringUtils.isEmpty(maxResults))