struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WW-1534) The value of checkbox getted in server-side is "false" when no any checkbox been selected.
Date Thu, 01 Jun 2017 06:06:04 GMT

     [ https://issues.apache.org/jira/browse/WW-1534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart updated WW-1534:
------------------------------
    Description: 
jsp section:
{code:xml}
<s:iterator value="%{#request.rolePs.items}" id="role" status="status">

   <tr >
                <td height="25" width="5%">
                    <s:checkbox name="roleId" fieldValue="%{id}" theme="simple"/>
                </td>
   </tr>
........
</s:iterator>
{code}

action section:

{code:java}
....
       private String[] roleId;
	public String[] getRoleId() {
		return roleId;
	}

	public void setRoleId(String[] roleId) {
		this.roleId = roleId;
	}
.....
{code}

the retrieved value of  "roleId" is {{false}}  when user doesn't select any checkbox elements.
 In my opinion, this case should returns null directly.




  was:
jsp section:

<s:iterator value="%{#request.rolePs.items}" id="role" status="status">

   <tr >
                <td height="25" width="5%">
                    <s:checkbox name="roleId" fieldValue="%{id}" theme="simple"/>
                </td>
   </tr>
........
</s:iterator>

action section:
....
       private String[] roleId;
	public String[] getRoleId() {
		return roleId;
	}

	public void setRoleId(String[] roleId) {
		this.roleId = roleId;
	}
.....

the retrieved value of  "roleId" is {"false"}  when user doesn't select any checkbox elements.
 In my opinion, this case should returns null directly.





> The value of checkbox getted in server-side is "false" when no any checkbox been selected.
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-1534
>                 URL: https://issues.apache.org/jira/browse/WW-1534
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Value Stack
>    Affects Versions: 2.0.1
>         Environment: tomcat-5.5.20 / jdk1.5.0.08
>            Reporter: Ling Chang Ming
>             Fix For: 2.5.x
>
>
> jsp section:
> {code:xml}
> <s:iterator value="%{#request.rolePs.items}" id="role" status="status">
>    <tr >
>                 <td height="25" width="5%">
>                     <s:checkbox name="roleId" fieldValue="%{id}" theme="simple"/>
>                 </td>
>    </tr>
> ........
> </s:iterator>
> {code}
> action section:
> {code:java}
> ....
>        private String[] roleId;
> 	public String[] getRoleId() {
> 		return roleId;
> 	}
> 	public void setRoleId(String[] roleId) {
> 		this.roleId = roleId;
> 	}
> .....
> {code}
> the retrieved value of  "roleId" is {{false}}  when user doesn't select any checkbox
elements.  In my opinion, this case should returns null directly.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message