The inputNumber declaration below will not accept any input, however when I removed the minValue attribute, it accept input. What am not doing wrong here?
code xhtml:
<a:column>
<p:inputNumber id="year"
value="#{consomationControleur.myYear}"
maxValue="#{now.year + 1900}"
minValue="2000"
>
<p:ajax event="blur" process="@this"/>
</p:inputNumber>
</a:column>
java CDI bean
@Getter
@Setter
@Named("consomationControleur")
@ViewScoped
public class ConsomationControleur implements Serializable {
private int myYear;
//...
}
jsf version 2.2 primefaces version 11
I tried to remove the maximum value. I tried to set minValue to a negative value, it works, but I need the years 1990-2022. So I only need positive values.
I would like to make a note
minValue="1980" maxValue="#{now.year + 1900}"
it works but because of JS
but because of JS When you write a value, you selected the input and you type a number (like 2), the JS triter this value, and as the minimum condition is 1980, automate re update the input and put the field to minimum value 1980.
to work you have to select only the 3rd number (8) and change it, change a number by one, it's bad, but it works like this .
or you using <f:validateLongRange minimum = "" maximum = "" />
<p:inputNumber value="#{consomationControleur.anneeActuel}" >
<f:validateLongRange minimum = "1900" maximum = "#{now.year + 1900}" />
<p:ajax event="blur" update="display2" process="@this"/> </p:inputNumber>