This content has been marked as final. Show 5 replies
Welcome to OTN. The behavior you are noticing is expected. If you would like to display a custom exception/convertor, check out this doc.
have an af:table with the filtering enabledon corrosponding field add af:convertNumber tag like
So instead of throwing exception it will prompt the user to add a numeric value..
<af:inputText> <af:convertNumber/> </af:inputText>
Thanks for the replies.
I was aware of those "fixes" except that
- users need to be able to use < or > in the filter criteria, so restricting them to numbers is not a solution
- the custom implemenation is a lot of work for something I would expected ADF to deal with.
I don't get the number exception when I enter "> 100" or "< 100" so the < and > seem to pass succesfully.
But if by accident I enter "= 100" instead of "100" it throws the number exception
So I still feel this should be handled more gracefully out of the box.
Here is a simple workaround that I make use of, might help!
Consider I have a bind variable searchString of String type being used in a view criteria. View criteria has a numeral attribute as well as text attribute to compare with :searchString. Now what I do to avoid the exception is that I create another bind variable called searchStringForInt of String type. I set the value of this bind variable as expression type "+searchString != null ? searchString.replaceAll("\\D+","") : null+" and use this :searchStringForInt for comparing with numeral attribute instead of :searchString.
Also FYI, QBE behaviour can be customized. Take a look at http://radio-weblogs.com/0118231/stories/2003/07/11/implementingAViewCriteriaAdapterToCustomizeQueryByExampleFunctionality.html.