Issue 80: boolean primative filter value
Status:  Accepted
Owner:
extremec...@gmail.com
Reported by extremec...@gmail.com, Jan 30, 2008
 1- Using the jMesa tag library, I define one of my column with a
 property of type boolean. This displays either "true" or "false" in> the
column. When I apply a filter, I get the following error stack
 trace :
 
 java.lang.IllegalArgumentException: There is no FilterMatcher with the
 MatcherKey
 [org.jmesa.core.filter.MatcherKey@d185fe[type=boolean,property=mpsFilenamingSiteNames]]
 
 I'm guessing the default String Filter Matcher does not apply by
 default since a boolean is a primitive type. Should I create a
 FilterMatcherMap just for that? Shouldn't jMesa handle this by
 default?


Jan 30, 2008
#1 extremec...@gmail.com
The filters were not created with primitives in mind. To be honest I just didn't even
think about that when I drew up the class diagrams for that feature. What you could
do is declare a method in your item (Bean or Map) that returns a Boolean object. That
would be not be expensive even with the auto-unboxing because behind the scenes the
JVM would create an immutable object to use.
Mar 10, 2008
#2 extremec...@gmail.com
(No comment was entered for this change.)
Labels: -Type-Defect Type-Enhancement
Mar 10, 2008
#3 extremec...@gmail.com
(No comment was entered for this change.)
Labels: -Priority-Medium Priority-Low
Apr 28, 2008
#4 im.ashis...@gmail.com
Im also facing the same problem but i just cannot modify my bean as it is getting
used extensively in other parts of the application. Do we have FilterOption
implementation in jmesa, the way we used to have in extremetable.
May 13, 2009
#5 AlejaV...@gmail.com
Even it is an old thread, I faced the same issue and this works for me:

tableFacade.addFilterMatcher(new MatcherKey(boolean.class), new StringFilterMatcher());
This applies the default StringFilterMatcher to a boolean column or bean property. So
you can filter writting "true" or "false" (or "t","f"...). But I prefer adding also
this to the boolean columns:
column.getFilterRenderer().setFilterEditor(new DroplistFilterEditor());

So you can choose between "true" and "false" in the filter editor.

I'm dealing with a lot of boolean columns and have almost finished a new
CheckBoxCellEditor (which can work even when exporting), with several parameters.
Where should I send or post it for others to evaluate?

Cheers,
Alex
May 13, 2009
#6 AlejaV...@gmail.com
I will open a new Issue with my proposed CheckBoxCellEditor