For the input text field below, User can enter the values between one and 99,999. Enter only numbers.
<p:message for="usage" display="text"><p:autoUpdate/></p:message>
<p:inputText id="usage" maxlength="10" required="true"
requiredMessage="You must provide an input" value="#{powerMB.usage}">
<f:validateDoubleRange minimum="1" maximum="99999" for="usage" />
<p:keyFilter regEx="/[0-9]/i" />
</p:inputText>
Current Input values accept - examples
1
34
99
3534
53535
I have tried to mask a specific input values as per
How to restrict Primefaces inputMask to numbers only?
https://www.primefaces.org/showcase/ui/input/inputMask.xhtml
Tried to add a comma for numbers more than 999
I receive the following error for the code below
usage: Validation Error: Value is not of the correct type
<p:message for="usage" display="text"><p:autoUpdate/></p:message>
<p:inputMask id="usage" maxlength="5" required="true"
requiredMessage="You must provide an input" mask="99,999" value="#{powerMB.usage}">
<f:validateDoubleRange minimum="1" maximum="99999" for="usage" />
</p:inputMask>
Input Given as
1 fail validation error
34 fail
99 fail
3534 fail
53535 fail
00,001 fail validation error
00,034 fail
00,099 fail
03,534 fail
053,535 fail
unable to accept input values after I use inputMask
Can provide a full working code of the existing functionality if needed.