You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2022/06/15 13:04:57 UTC

[struts] branch WW-5191-textarea-max-length updated (75ea7709e -> 2aa31a2b3)

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

lukaszlenart pushed a change to branch WW-5191-textarea-max-length
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard 75ea7709e WW-5191 Fixes placement of maxLength and minLength attributes in <s:textarea/> tag
     new 2aa31a2b3 WW-5191 Fixes placement of maxLength and minLength attributes in <s:textarea/> tag

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (75ea7709e)
            \
             N -- N -- N   refs/heads/WW-5191-textarea-max-length (2aa31a2b3)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 core/src/test/java/org/apache/struts2/views/jsp/ui/TextareaTest.java | 2 ++
 1 file changed, 2 insertions(+)


[struts] 01/01: WW-5191 Fixes placement of maxLength and minLength attributes in tag

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5191-textarea-max-length
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 2aa31a2b3905162b43a0e4eb893d96da62d5f911
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Wed Jun 15 14:49:02 2022 +0200

    WW-5191 Fixes placement of maxLength and minLength attributes in <s:textarea/> tag
---
 core/src/main/resources/template/simple/textarea.ftl       | 14 +++++++-------
 .../java/org/apache/struts2/views/jsp/ui/TextareaTest.java |  4 ++++
 .../org/apache/struts2/views/jsp/ui/Textarea-1.txt         |  2 +-
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/core/src/main/resources/template/simple/textarea.ftl b/core/src/main/resources/template/simple/textarea.ftl
index f08826f1e..b3f653ced 100644
--- a/core/src/main/resources/template/simple/textarea.ftl
+++ b/core/src/main/resources/template/simple/textarea.ftl
@@ -45,6 +45,12 @@
 <#if parameters.title?has_content>
  title="${parameters.title}"<#rt/>
 </#if>
+<#if parameters.maxlength?has_content>
+ maxlength="${parameters.maxlength}"<#rt/>
+</#if>
+<#if parameters.minlength?has_content>
+ minlength="${parameters.minlength}"<#rt/>
+</#if>
 <#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" />
 <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" />
 <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" />
@@ -52,10 +58,4 @@
 <#if parameters.nameValue??>
 <@s.property value="parameters.nameValue"/><#t/>
 </#if>
-<#if parameters.maxlength?has_content>
- maxlength="${parameters.maxlength}"<#rt/>
-</#if>
-<#if parameters.minlength?has_content>
- minlength="${parameters.minlength}"<#rt/>
-</#if>
-</textarea>
\ No newline at end of file
+</textarea>
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/TextareaTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/TextareaTest.java
index d94bbd2c5..c83086255 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/ui/TextareaTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/TextareaTest.java
@@ -47,6 +47,8 @@ public class TextareaTest extends AbstractUITagTest {
         tag.setId("the_id");
         tag.setOnkeyup("alert('hello');");
         tag.setReadonly("true");
+        tag.setMaxlength("100");
+        tag.setMinlength("10");
 
         tag.doStartTag();
         tag.doEndTag();
@@ -81,6 +83,8 @@ public class TextareaTest extends AbstractUITagTest {
         tag.setId("the_id");
         tag.setOnkeyup("alert('hello');");
         tag.setReadonly("true");
+        tag.setMaxlength("100");
+        tag.setMinlength("10");
 
         tag.doStartTag();
         setComponentTagClearTagState(tag, true);  // Ensure component tag state clearing is set true (to match tag).
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textarea-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textarea-1.txt
index 3b6fe998c..c40a1160d 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textarea-1.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Textarea-1.txt
@@ -1,4 +1,4 @@
 <tr>
     <td class="tdLabel"><label for="the_id" class="label">mylabel:</label></td>
-    <td class="tdInput"><textarea name="myname" cols="20" rows="30" disabled="disabled" readonly="readonly" tabindex="5" id="the_id" title="mytitle" onclick="alert('onclick');" onkeyup="alert('hello');" onchange="alert('goodbye');">bar</textarea></td>
+    <td class="tdInput"><textarea name="myname" cols="20" rows="30" disabled="disabled" readonly="readonly" tabindex="5" id="the_id" title="mytitle" maxlength="100" minlength="10" onclick="alert('onclick');" onkeyup="alert('hello');" onchange="alert('goodbye');">bar</textarea></td>
 </tr>