Hi Alejandro,
I am working with the latter version of Jahia (4.1 branch) and the ContainerFilterBean already has a constructor that explicitly accepts number format as a parameter.
I have just taken a look at the source code of the Jahia 4.0.5. It seems, that the number filtering only works for long values and not for float or double.
If you have Jahia's source code, you could check the compare(...) method in the FilterClause class. The values 'valueFrom' and 'valueTo', which you specify by calling addRangeClause(...) method,
are converted there using Long.parseLong(), which is valid only for values of type long.
Kind regards.
Sergiy.
| Alejandro Fernández <[EMAIL PROTECTED]>
24.04.2006 18:27
|
|
Hi,
I am trying to apply a filter to a container in a field defined as Float. I have only found how to add a RangeClause to a ContainerFilterBean in the case of string and date, but not Float.
I am working with Jahia 4.0.5. and this is the source code for the filtering:
myContainerFilter = new ContainerFilterBean("aFloatField", true, jParams.getEntryLoadRequest()); // with the field name
// Adding equality comparison with selected values
myContainerFilter.addRangeClause(">","<",valueFrom,valueTo);
This filtering always returns 0 element found, because only String values are allowed for the fields valueFrom and valueTo.
Thank you for your helping.
Cheers.
Alex.
