PrimeFaces Extensions - Empty Value Attribute

On my page, I have <pe:inputNumber> , which refers to an optional field. If I leave it empty, it sets the value to 0, even if I set emptyValue = "" . What should I do or what should I use if this component cannot offer me this functionality?

+4
source share
1 answer

You may need to specifically instruct JSF to interpret empty input fields as null, rather than force it to "0" using the context-param parameter

 <context-param> <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> <param-value>true</param-value> </context-param> 

In addition, for a container created on tomcat (JBoss, WSphere, etc.), you must set the following JVM configuration property (quite easy to do in the IDE).

 -Dorg.apache.el.parser.COERCE_TO_ZERO=false 
+6
source

All Articles