hi,

i solved this problem the following way:

1. created a custom reset interceptor to set the action class field of
checkbox.
2. placed the interceptor just after the scope interceptor (in ur
struts.xml) 

when u deselect all the checkboxes then the HTML doesnt submit any values to
the action class and hence the class doesnt update the field value. So, here
we always reset the respective field so  the field is updated only iff some
checkbox values are sent by the HTML.

hope this helps.
cheers,
ravi  


Hoying, Ken-2 wrote:
> 
> I did not have any errors.  I am not sure exactly what I was doing that
> caused this not to work, but I reorganized my code in the action class
> and was able to make things work.   
> 
> -----Original Message-----
> From: Greg Lindholm [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 20, 2008 2:37 PM
> To: user@struts.apache.org
> Subject: Re: Struts[2] : Checkboxlist Problems
> 
> 
> Are you getting any errors?
> 
> There is a bug in the CheckboxInterceptor where it does not properly
> handling arrays of checkboxes when none are selected.  It might be
> related, but this issue did causes error messages.
> 
> I submitted a patch for this issue WW-2339.  
> https://issues.apache.org/struts/browse/WW-2339
> 
> 
> 
> Hoying, Ken-2 wrote:
>> 
>> I have a list of search filters that I am displaying on the page where
> 
>> each is a checkboxlist.  I am implementing this as such:
>> 
>> <s:iterator value="searchCriteria.filters" status="filterStatus">
>>      <s:checkboxlist
>>      
>> name="searchCriteria.filterMap['%{fieldName}'].selectedFilters" 
>>              value="%{selectedFilters}"
>> 
>>              list="filterItems" listKey="value" listValue="label"/>
> </s:iterator>
>> 
>> Everything works great except for one small problem.  I do not seem to
> 
>> be able to deselect all of the values for a filter.  For example, if 
>> one of my filters is Status and the check box values are Active and 
>> Inactive
>> then:
>> 
>> - I can select both Active and Inactive.
>> - I can leave both Active and Inactive deselected.
>> - I can default to have Active selected and then deslect it and then 
>> select Inactive.
>> - I CANNOT default to have Active selected and then deselect it. 
>> 
>> It appears that if a checkbox was originally set you can change the 
>> value as long as you change it to some other value.  However if I do 
>> not set the field to any value at all, then it keeps the previous or 
>> default value.
>> 
>> I am not sure what is occurring here.  Does anyone have any ideas on 
>> how I can overcome this?
>> 
>> Thank you!
>> Ken
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/Struts-2--%3A--Checkboxlist-Problems-tp17339322p17
> 347543.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2--%3A--Checkboxlist-Problems-tp17339322p17355805.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to