From 17008e6d01379efa3f4a236e13bffd6ba9e4b8c4 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 24 Sep 2024 10:04:20 +0200 Subject: [PATCH] Support textarea widget for multifield (array) properties --- .../angularjs-partials/multifield.html | 27 ++++++++++++++++--- .../propertyInputTextarea.html | 2 ++ .../js/widgets/multifield.directive.js | 6 +++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/bundle/src/main/resources/angularjs-partials/multifield.html b/bundle/src/main/resources/angularjs-partials/multifield.html index 696a84bd..951f0e33 100644 --- a/bundle/src/main/resources/angularjs-partials/multifield.html +++ b/bundle/src/main/resources/angularjs-partials/multifield.html @@ -34,8 +34,14 @@ ng-model="effectiveValue.value" /> + @@ -57,8 +63,14 @@ ng-model="value.value" /> + @@ -81,8 +93,15 @@
- +
diff --git a/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js b/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js index e4e5f2a0..e7e0aa7c 100644 --- a/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js +++ b/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/multifield.directive.js @@ -55,6 +55,12 @@ scope.validation = props.validation; scope.validationMessage = props.validationMessage ? Granite.I18n.get(props.validationMessage) : undefined; + // special handling for textarea + if (props.widgetType === "textarea") { + scope.type = "textarea"; + scope.textareaRows = props.textareaRows; + } + setValueArray(scope.property.effectiveValue, scope.effectiveValues); setValueArray(scope.property.value, scope.values);