Reputation: 460
I am facing an issue in which on the jsff page, we have an af:inputText component and we need to restrict user to typing just (0-9 and a - sign) in the component. This has to be done while the user is typing and not on changing the focus to other UI component triggering a validation. I have tried the following things so far, but can't get around this issue.
1)Using javascript-> https://blogs.oracle.com/jdevotnharvest/sample-code:-how-to-prevent-character-input-in-a-rich-inputtext-field
2)Using f:convertNumber and af:convertNumber making the maxFractionDigits and minFractionDigits to 0, but still it is accepting .
3)Using af:inputText property of converter and setting it to javax.faces.Integer to accept only integers, but still able to type the .(period)
4)Using af:validateRegExp and using the following regex [0-9]{1,4}
Any ADF Expert kindly provide any known resolution to this problem without using javascript on the page itself.
Upvotes: 0
Views: 230
Reputation: 3721
If you need to prevent it while the user types then the Javascript solution is the only way to go. What didn't work for you in the blog your pointed to?
Upvotes: 1