You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by am...@apache.org on 2018/03/23 20:21:17 UTC
[struts] branch master updated: WW-4865 Change submitUnchecked type
to Boolean
This is an automated email from the ASF dual-hosted git repository.
amashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git
The following commit(s) were added to refs/heads/master by this push:
new 8eced24 WW-4865 Change submitUnchecked type to Boolean
8eced24 is described below
commit 8eced2493cd0a910cb843c9819997007f723c2e1
Author: Aleksandr Mashchenko <am...@apache.org>
AuthorDate: Fri Mar 23 22:20:44 2018 +0200
WW-4865 Change submitUnchecked type to Boolean
---
core/src/main/java/org/apache/struts2/components/Checkbox.java | 7 ++++---
core/src/main/resources/template/simple/checkbox.ftl | 2 +-
core/src/site/resources/tags/checkbox.html | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/core/src/main/java/org/apache/struts2/components/Checkbox.java b/core/src/main/java/org/apache/struts2/components/Checkbox.java
index 9f1f2b7..e8d86f5 100644
--- a/core/src/main/java/org/apache/struts2/components/Checkbox.java
+++ b/core/src/main/java/org/apache/struts2/components/Checkbox.java
@@ -73,10 +73,11 @@ public class Checkbox extends UIBean {
} else {
addParameter("fieldValue", "true");
}
+
if (submitUnchecked != null) {
- addParameter("submitUnchecked", findString(submitUnchecked));
+ addParameter("submitUnchecked", findValue(submitUnchecked, Boolean.class));
} else {
- addParameter("submitUnchecked", "false");
+ addParameter("submitUnchecked", false);
}
}
@@ -89,7 +90,7 @@ public class Checkbox extends UIBean {
this.fieldValue = fieldValue;
}
- @StrutsTagAttribute(description="If set to true, unchecked elements will be submitted with the form.", defaultValue="false")
+ @StrutsTagAttribute(description="If set to true, unchecked elements will be submitted with the form.", type="Boolean", defaultValue="false")
public void setSubmitUnchecked(String submitUnchecked) {
this.submitUnchecked = submitUnchecked;
}
diff --git a/core/src/main/resources/template/simple/checkbox.ftl b/core/src/main/resources/template/simple/checkbox.ftl
index a55d0a9..9be8337 100644
--- a/core/src/main/resources/template/simple/checkbox.ftl
+++ b/core/src/main/resources/template/simple/checkbox.ftl
@@ -39,7 +39,7 @@
<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" />
<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" />
/>
-<#if (parameters.submitUnchecked?boolean)!false>
+<#if parameters.submitUnchecked!false>
<input type="hidden" id="__checkbox_${parameters.id?html}" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}"<#rt/>
<#if parameters.disabled!false>
disabled="disabled"<#rt/>
diff --git a/core/src/site/resources/tags/checkbox.html b/core/src/site/resources/tags/checkbox.html
index 204d35c..abe521a 100644
--- a/core/src/site/resources/tags/checkbox.html
+++ b/core/src/site/resources/tags/checkbox.html
@@ -302,7 +302,7 @@ Please do not edit it directly.
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
- <td align="left" valign="top">String</td>
+ <td align="left" valign="top">Boolean</td>
<td align="left" valign="top">If set to true, unchecked elements will be submitted with the form.</td>
</tr>
<tr>
--
To stop receiving notification emails like this one, please contact
amashchenko@apache.org.