You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Ling Chang Ming (JIRA)" <ji...@apache.org> on 2006/12/04 10:34:57 UTC

[jira] Created: (WW-1534) The value of checkbox getted in server-side is "false" when no any checkbox been selected.

The value of checkbox getted in server-side is "false" when no any checkbox been selected.  
--------------------------------------------------------------------------------------------

                 Key: WW-1534
                 URL: http://issues.apache.org/struts/browse/WW-1534
             Project: Struts 2
          Issue Type: Bug
          Components: Value Stack
    Affects Versions: 2.0.1
         Environment: tomcat-5.5.20 / jdk1.5.0.08
            Reporter: Ling Chang Ming


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.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (WW-1534) The value of checkbox getted in server-side is "false" when no any checkbox been selected.

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-1534:
--------------------------

    Issue Type: Improvement  (was: Bug)

> The value of checkbox getted in server-side is "false" when no any checkbox been selected.
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-1534
>                 URL: https://issues.apache.org/struts/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: Future
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1534) The value of checkbox getted in server-side is "false" when no any checkbox been selected.

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1534?page=comments#action_39212 ] 
            
Don Brown commented on WW-1534:
-------------------------------

Setting the property to null makes sense in this situation, but the more common one is where the property is a boolean.  Any idea how we could construct a value that OGNL would treat as either null if the value is a string or false if a boolean?

> The value of checkbox getted in server-side is "false" when no any checkbox been selected.
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-1534
>                 URL: http://issues.apache.org/struts/browse/WW-1534
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Value Stack
>    Affects Versions: 2.0.1
>         Environment: tomcat-5.5.20 / jdk1.5.0.08
>            Reporter: Ling Chang Ming
>             Fix For: Future
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira