You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Denis Ling <de...@gmail.com> on 2006/12/18 10:28:10 UTC

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

 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.

I very appreciate anybody who can give me any suggestion!
-- 
Thanks & Regards
Denis Ling