From 32ed646bfad182be9df729b7cd826a5e605042f2 Mon Sep 17 00:00:00 2001
From: Benjamin Ulrich <b.ulrich@adito.de>
Date: Mon, 25 May 2020 12:02:56 +0000
Subject: [PATCH] =?UTF-8?q?[Projekt:=20Entwicklung=20-=20Neon][TicketNr.:?=
 =?UTF-8?q?=201052591][[Eigenschaft]=20-=20Button=20"Untergeordnete=20Eige?=
 =?UTF-8?q?nschaft=20anlegen"=20aktiv=20wenn=20mehr=20als=20eine=20Eigensc?=
 =?UTF-8?q?haft=20ausgew=C3=A4hlt=20wurde]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 entity/Attribute_entity/Attribute_entity.aod             | 2 ++
 .../children/newchildattribute/stateProcess.js           | 9 +++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js

diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod
index 4ffbcecb99..81ed998586 100644
--- a/entity/Attribute_entity/Attribute_entity.aod
+++ b/entity/Attribute_entity/Attribute_entity.aod
@@ -323,6 +323,8 @@
           <isObjectAction v="false" />
           <isSelectionAction v="true" />
           <iconId>VAADIN:FILE_TREE_SMALL</iconId>
+          <state>AUTO</state>
+          <stateProcess>%aditoprj%/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js</stateProcess>
         </entityActionField>
       </children>
     </entityActionGroup>
diff --git a/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js b/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js
new file mode 100644
index 0000000000..8d1104b5aa
--- /dev/null
+++ b/entity/Attribute_entity/entityfields/attributeactions/children/newchildattribute/stateProcess.js
@@ -0,0 +1,9 @@
+import("Attribute_lib");
+import("system.result");
+import("system.vars");
+import("system.neon");
+
+if(vars.get("$sys.selection").length == 1 && vars.get("$field.ATTRIBUTE_TYPE") == $AttributeTypes.GROUP.toString())
+    result.string(neon.COMPONENTSTATE_EDITABLE)
+else
+    result.string(neon.COMPONENTSTATE_DISABLED)
\ No newline at end of file
-- 
GitLab