I want to restrict p:inputMask
to numbers only, and I tried the proposed solutions from:
But none of them worked. I tried these two ways:
<p:inputMask id="userNo" maxlength="2" mask="9?9999" />
and
<p:inputMask id="userNo" maxlength="2" >
<pe:keyFilter regEx="/[0-9_]/i"/>
</p:inputMask>
I think that approach is right but I noticed that you don't put
value
attribute oninputMask
. Do you try to put it on?inputMaskTest.xhtml:
InputMaskView.java: