You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/10/31 15:15:56 UTC

[sling-org-apache-sling-app-cms] 02/02: SLING-8719 - Minor add to support populating the field values from a request scope

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit 88c20fd67c146c28223561ae01bd36865b6468fb
Author: Dan Klco <dk...@apache.org>
AuthorDate: Thu Oct 31 11:15:42 2019 -0400

    SLING-8719 - Minor add to support populating the field values from a
    request scope
---
 .../apps/reference/components/forms/fields/textarea/textarea.jsp   | 7 +++++--
 .../apps/reference/components/forms/fields/textfield/textfield.jsp | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textarea/textarea.jsp b/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textarea/textarea.jsp
index b3c3a61..e046a87 100644
--- a/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textarea/textarea.jsp
+++ b/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textarea/textarea.jsp
@@ -32,6 +32,9 @@
         <c:when test="${not empty formData[properties.name]}">
             <c:set var="fieldValue" value="${formData[properties.name]}" />
         </c:when>
+        <c:when test="${not empty requestScope[properties.name]}">
+            <c:set var="fieldValue" value="${requestScope[properties.name]}" />
+        </c:when>
         <c:when test="${not empty properties.value}">
             <c:set var="fieldValue" value="${properties.value}" />
         </c:when>
@@ -39,6 +42,6 @@
     <textarea class="${formConfig.fieldClass}" id="${properties.name}" name="${properties.name}" ${properties.required ? 'required="required"' : ''}
         <c:forEach var="attr" items="${properties.additionalAttributes}">
             ${fn:split(attr,'\\=')[0]}="${fn:split(attr,'\\=')[1]}"
-        </c:forEach> 
+        </c:forEach>
         >${fieldValue}</textarea>
-</div>
\ No newline at end of file
+</div>
diff --git a/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textfield/textfield.jsp b/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textfield/textfield.jsp
index d5bf932..09d5cfa 100644
--- a/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textfield/textfield.jsp
+++ b/reference/src/main/resources/jcr_root/apps/reference/components/forms/fields/textfield/textfield.jsp
@@ -34,6 +34,9 @@
         <c:when test="${not empty formData[properties.name]}">
             <c:set var="fieldValue" value="${formData[properties.name]}" />
         </c:when>
+        <c:when test="${not empty requestScope[properties.name]}">
+            <c:set var="fieldValue" value="${requestScope[properties.name]}" />
+        </c:when>
         <c:when test="${not empty properties.value}">
             <c:set var="fieldValue" value="${properties.value}" />
         </c:when>