Michael Gagnon wrote:
My JSP resembles:
....
<s:form namespace="/labs" action="ApproveItems" method="post" >
....
<s:iterator value="loggedInUser.approvableBillingItems"
status="stat" id="next">
<s:hidden name="itemsPresent" value="%{id}"/>
...
<td><s:checkbox name="approved" fieldValue="%{id}"
required="false"/></td>
...
</s:iterator>
....
</s:form>
....
My action resembles:
....
public class ApproveItemsAction extends ActionSupport {
private Integer[] approved;
private Integer[] itemsPresent;
...
public void setApproved(Integer[] approved){ this.approved =
approved; }
public void setItemsPresent(Integer[] itemsPresent){
this.itemsPresent = itemsPresent; }
}
When some number of checkboxes are selected, then I get an array containing
the ID values of the checked objects. This is correct. When NO checkboxes
are selected, I get:
No result defined for action bpf.labs.action.ApproveItemsAction and result
input
Which is not expected. My action never hits the execute method in this
scenario. It never even hits 'setApproved' (it does if there are values
checked. It does not if there are none). I expect setApproved be called with
an empty array or just null. Either is acceptable -- Null being what I
expect I'd PROBABLY see and an empty array being what I'd be HAPPY to see.
Instead this situation just seems to confuse struts and 'input' is returned
at what looks like the time the parameter interceptor is probably trying to
handle the checkboxes.
Is there a way to handle this? Having no checkboxes selected needs to be an
acceptable form submission state for this action. My itemsPresent array must
be null or an empty array.
Forwarding to 'input' usually means a validation error occurred. Do you
have any validation configured for this action?
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]