[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Re: No result defined for action and result input with checkbox
From:       Greg Lindholm <glindholm () yahoo ! com>
Date:       2008-04-30 13:41:52
Message-ID: 16982793.post () talk ! nabble ! com
[Download RAW message or body]


I had the same (or similar) problem, it's caused be the CheckboxInterceptor
not properly handling arrays of checkboxes when none are selected.
I submitted a patch for this issue 
https://issues.apache.org/struts/browse/WW-2339 WW-2339  but I don't think
anyone has looked at it yet.


wild_oscar wrote:
> 
> I have a problem that can be stripped down to the following: a jsp with a
> form:
> 
> 	<s:form action="batch">
> 		<s:checkbox name="formReturned" theme="simple" fieldValue="0"
> value="false"></s:checkbox>
> 		 <s:checkbox name="formReturned" theme="simple" fieldValue="1"
> value="false"></s:checkbox>
> 		 <s:submit></s:submit>	
> 	</s:form>
> 
> 
> The action has a 
> 
> private int[] formReturned;
> 
> with getters and setters.
> 
> If any of the two checkboxes are checked, formReturned will be a vector
> with the fieldValue(s) of the checked box(es).
> 
> However, if neither checkboxes are checked, it will be null and Struts
> will send me to the Input (which is not configured).
> 
> I even tried to set:
> 	public void prepare() throws Exception {
> 		if(formReturned==null)
> 		{
> 			log.warn("Miguel - warning, null value!");
> 			formReturned = new int[2];
> 			
> 		}		
> 	}
> To see if it was a problem of null formReturned value, but it is not.
> Struts will set formReturned = new int[2], but it'll go to the error
> (before running the action) anyway.
> 
> The full stacktrace is  http://pastebin.com/m43225ede
> http://pastebin.com/m43225ede .
> 
> How can I prevent struts from trying to return to the input? What sort of
> validation is it failing (I don't have any validation on any field)?
> 
> Thank you very much for any help!
> 

-- 
View this message in context: \
http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-tp16966533p16982793.html
 Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic