RE: Filtering with float fields

Alejandro Fernández <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Organization mediadvanced
Message-ID <200604271023788.SM01920@rewind>
Hi Sergiy,
 
We will consider performing a upgrade to the latest version of the product.
Thanks for your helping.
 
Best regards.
 
Alex.

  _____  

De: [email protected] [mailto:[email protected]] 
Enviado el: martes, 25 de abril de 2006 14:18
Para: [email protected]
Asunto: Re: Filtering with float fields



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 


Please respond to
<[email protected]>



To
<[email protected]> 

cc

Subject
Filtering with float fields

	




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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.