KeyFilter can be used to filter keyboard input on specified input components.

Predefined masks and their regular expressions:
pint /[\d]/
int /[\d\-]/
pnum /[\d\.]/
money /[\d\.\s,]
num /[\d\-\.]/
hex /[0-9a-f]/i
email /[a-z0-9_\.\-@]/i
alpha /[a-z_]/i
alphanum /[a-z0-9_]/i

KeyFilter with regEx on a p:inputText
KeyFilter with mask on a h:inputText
KeyFilter with testFunction on a p:autoComplete
Predefined masks and their regular expressions:

<br />
<br />

    <h:panelGrid columns="2">  
        <h:outputText value="KeyFilter with regEx on a p:inputText" />  
        <p:inputText id="text1">
            <p:keyFilter regEx="/[ABC]/i"/>  

        <h:outputText value="KeyFilter with mask on a h:inputText"/>  
        <h:inputText id="text2" /> 

        <h:outputText value="KeyFilter with testFunction on a p:autoComplete" />  
        <p:autoComplete id="autoComplete1" value="#{autoCompleteView.txt1}" completeMethod="#{autoCompleteView.completeText}" />  
    <p:keyFilter for="text2" mask="num"/>
    <p:keyFilter for="autoComplete1" testFunction="return c == 'z';"/>


Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega


Create awesome applications in no time using the premium templates and impress your users.