Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1534

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.5.12
    • Component/s: Value Stack
    • Labels:
      None
    • Environment:

      tomcat-5.5.20 / jdk1.5.0.08

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                changming Ling Chang Ming
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: