f:convertnumber for decimal numbers


I was working on to filter the decimal value using the QBE feature in the af:table but was facing an issue with the conversion and filtering the values

as you all know that we use the custom filter QBE to filter custom types other than String using the snippet


<af:column>

....

<f:facet name="filter">
 <af:inputText label="2" id="it2" value="#{vs.filterCriteria.id}">
 <f:convertNumber groupingUsed="false" integerOnly="true"/>
 inputText>
 </f:facet>

...

I thought of filtering the decimal values using the option available in af:convertNumber


<af:column>

....

<f:facet name="filter">
 <af:inputText label="2" id="it2" value="#{vs.filterCriteria.id}">
 <f:convertNumber groupingUsed="false" maxFractionDigits="2" patter="#.##" minFractionDigits="1" maxIntegerDigits="1"/>
 </af:inputText>
 </f:facet>

...

But the above options didn’t work as expected.

Finally I found the way to filter the double values using convertor=”javax.faces.Double”


<af:column>

....

<f:facet name="filter">
 <af:inputText label="2" id="it2" value="#{vs.filterCriteria.id}" convertor="javax.faces.Double"/>
 </af:inputText>
 </f:facet>

...

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s