I found the answer :)
 
I just made a mistake in the constructor of ContainerFilterBean :  i putted 
"true" instead of "false" (to force numeric conversion).
 
So, the clause to define a filter on a boolean filed is just like this : 
booleanFilter.addClause(ContainerFilterBean.COMP_EQUAL, "true");       //or 
false, of course
 
Guillaume KUHMEL - Consultant

________________________________

De: Guillaume KUHMEL [mailto:[EMAIL PROTECTED]
Date: mar. 1/16/2007 10:12
À: [email protected]
Cc: [email protected]
Objet : filtering depending on the value of a boolean field


Hi everybody,
 
 
I'd like to create a filter based on the value of a boolean field of my 
container.
first i have my declaration of my container, with my field:
 
<content:declareField name="toto" title="toto" titleKey="toto" bundleKey="<%= 
CompositePartenaire.BUNDLE_ID%>" type="Boolean" />

so i create a checkbox, to filter on the value of this field :
<input type="checkbox" name="<%=paramName%>" id="<%=paramName%>" value="true" 
<%=paramValue? "checked=\"checked\"" : "" %>/>

And after the submission i create the filter :

booleanFilter.addClause(ContainerFilterBean.COMP_EQUAL, 
String.valueOf(paramValue));

paramValue is the value sent by the checkbox.
 
But, it doesn't work !!  i guess that the value to compare is not 
"String.valueOf(paramValue)", but i don't know what must be my second parameter
 
Have someone already been dealing with such filters??? 
 
Thanks a lot !
Guillaume KUHMEL

Reply via email to