Tag Archives: query

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

Getting the value of Saved search – programatic way


QueryModel qm = (QueryModel)evaluateEL("#{bindings.SearchViewCriteriaQuery.queryModel}");
 for(int indexCount=0; indexCount
 {
 QueryDescriptor qd = qm.getUserQueries().get(indexCount);
 if(qd!=null){
 String queryDescriptorName = qd.getName();
 System.out.println(queryDesctiptorName);
 m = qd.getUIHints();
 isDefault = (Boolean) m.get(QueryDescriptor.UIHINT_DEFAULT);
 System.out.println(isDefault);
 isRunAutomatically = (Boolean) m.get(QueryDescriptor.UIHINT_AUTO_EXECUTE);
 System.out.println(isRunAutomatically);
 if (Boolean.TRUE.equals(isDefault) && Boolean.TRUE.equals(isRunAutomatically){
 break();
 }
 else{
 queryDescriptorName = null;
 }
 System.out.println(isDefault);
 }