Repository: syncope
Updated Branches:
refs/heads/master 0bc714db0 -> 95ee2ffe8
[SYNCOPE-1294] PlainSchemaDetailsPanel doesn't display the assigned validator
class
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/95ee2ffe
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/95ee2ffe
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/95ee2ffe
Branch: refs/heads/master
Commit: 95ee2ffe810336f3bf785e2d231fa15e71630919
Parents: 0bc714d
Author: Marco Di Sabatino Di Diodoro
Authored: Wed Apr 4 17:30:57 2018 +0200
Committer: Marco Di Sabatino Di Diodoro
Committed: Wed Apr 4 17:48:02 2018 +0200
--
.../client/console/panels/PlainSchemaDetails.java | 16 +++-
1 file changed, 7 insertions(+), 9 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/syncope/blob/95ee2ffe/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
--
diff --git
a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
index e62f289..3ec3c62 100644
---
a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
+++
b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
@@ -67,6 +67,8 @@ public class PlainSchemaDetails extends
AbstractSchemaDetailsPanel {
private final MultiFieldPanel enumerationKeys;
private final AjaxDropDownChoicePanel validator;
+
+private final AjaxDropDownChoicePanel type;
public PlainSchemaDetails(
final String id,
@@ -74,9 +76,9 @@ public class PlainSchemaDetails extends
AbstractSchemaDetailsPanel {
final PlainSchemaTO schemaTO) {
super(id, pageReference, schemaTO);
-
-final AjaxDropDownChoicePanel type = new
AjaxDropDownChoicePanel<>(
-"type", getString("type"), new PropertyModel<>(schemaTO,
"type"));
+
+type = new AjaxDropDownChoicePanel<>(
+"type", getString("type"), new
PropertyModel(schemaTO, "type"));
type.setChoices(Arrays.asList(AttrSchemaType.values()));
type.setEnabled(schemaTO == null || schemaTO.getKey() == null ||
schemaTO.getKey().isEmpty());
@@ -329,8 +331,6 @@ public class PlainSchemaDetails extends
AbstractSchemaDetailsPanel {
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
-
-schema.setValidator(null);
} else if (AttrSchemaType.Enum.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
@@ -355,8 +355,6 @@ public class PlainSchemaDetails extends
AbstractSchemaDetailsPanel {
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
-
-schema.setValidator(null);
} else if (AttrSchemaType.Encrypted.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
@@ -379,8 +377,6 @@ public class PlainSchemaDetails extends
AbstractSchemaDetailsPanel {
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
-
-schema.setValidator(null);
} else if (AttrSchemaType.Binary.ordinal() == typeOrdinal) {
conversionParams.setVisible(false);
conversionPattern.setModelObject(null);
@@ -430,7 +426,9 @@ public class PlainSchemaDetails extends
AbstractSchemaDetailsPanel {
binaryParams.setVisible(false);
mimeType.setModelObject(null);
mimeType.setChoices(null);
+}
+if (type.isEnabled() && AttrSchemaType.Binary.ordinal() !=
typeOrdinal) {
schema.setValidator(null);
}
}