I'm using keyfilter from Primefaces extensions library, <pe:keyfilter/>
. I use it together with regular expression which permits only numbers to be input. Everything works fine except that I can't paste a value into a field even if it fulfills regex. I mean I can't perform ctrl+v or right click -> paste with the mouse.
Is there workaround of this issue?
Or should I just use another validation method?
You could use <pe:inputNumber/>
instead as a input field.
To get integer numbers you could just use <pe:inputNumber value="..." decimalPlaces="0"/>
.
I just tested it and it worked with pasting numbers, but pasting text did also work. But when exiting the field, the wrong text input would then vanish. Not the best solution, but atleast you can paste numbers.