You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/03/23 19:52:00 UTC

[jira] [Commented] (WW-4865) Struts s:checkbox conversion fails to List

    [ https://issues.apache.org/jira/browse/WW-4865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411956#comment-16411956 ] 

ASF subversion and git services commented on WW-4865:
-----------------------------------------------------

Commit 3fd3196167301fd31ffc1c5dcf7111f394291f7f in struts's branch refs/heads/master from [~aleksandr-m]
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=3fd3196 ]

Merge pull request #169 from burtonrhodes/checkbox_requiredValue

WW-4865: Add "requiredValue" parameter to Checkbox Struts Tag

> Struts s:checkbox conversion fails to List<Integer>
> ---------------------------------------------------
>
>                 Key: WW-4865
>                 URL: https://issues.apache.org/jira/browse/WW-4865
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core, Core Tags
>    Affects Versions: 2.5.13
>            Reporter: Burton Rhodes
>            Priority: Minor
>             Fix For: 2.6
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Struts <s:checkbox> is not converted correctly to List<Integer> when only one checkbox element is present and checkbox is not checked.
> [Given]
> 1) Mapping s:checkbox to a List<Integer>
> 2) there is only one checkbox in the list
> 3) the checkbox is not checked when the form is submitted.  
> [Result]
> Input invalid
> The issue is caused by the checkbox tag using the "submit unchecked values" design pattern.  As a result, the code base tries to convert the value of the single unchecked element to false (rather than not setting any value of the List<Integer>).
> Fix: Allow the developer to choose if the "submit unchecked values" is to be implemented.  Add a new parameter to the s:checkbox tag ("requiredValue").  Default of requiredValue=true for backwards compatibility.  When set to false, no hidden input values will be displayed in the view.  This flexibility might be needed in other scenarios as well.
> Pull Request:  https://github.com/apache/struts/pull/169



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)