JARCH SHOWCASE
JARCH SHOWCASE
KeyFilter 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
<a:form>
    <h:panelGrid columns="2">   
        <h:outputText value="KeyFilter with regEx on a p:inputText"/>   
        <a:inputText id="text1">
            <a:keyFilter regEx="/[ABC]/i"/>
        </a:inputText>

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

        <h:outputText value="KeyFilter with testFunction on a p:autoComplete" />  
        <a:autoComplete id="autoComplete1" value="#{autoCompleteView.txt1}" completeMethod="#{autoCompleteView.completeText}" />
    </h:panelGrid> 

    <a:keyFilter for="text2" mask="num" />
    <a:keyFilter for="autoComplete1" testFunction="return c == 'z';" />
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.