pe:inputNumber does not respect required="false" forces 0.0
Posted: 06 Aug 2012, 22:48
pe:inputNumber currently does not permit a value of null, even when required="false" is set explicitly.
If it loads say within a p:inplace when the value is null, it issues the warning:
"The value is null or empty. Default value 0.0 will be used."
This is from this code:
This is an unwarranted assumption, and in my case it undermines the use of null in an expert system to stand for UNDEF or "not known yet", especially when combined with p:inplace and emptyLabel="UNDEF".
Q: Could you possibly change this behavior to permit null values in pe:inputNumber and a neutral display when the value is null, instead of 0.0 ?
If it loads say within a p:inplace when the value is null, it issues the warning:
"The value is null or empty. Default value 0.0 will be used."
This is from this code:
Code: Select all
public class InputNumberRenderer extends InputRenderer {
..
private String formatForPlugin(final String valueToRender) {
if (valueToRender == null || valueToRender.isEmpty()) {
LOGGER.warning("The value is null or empty. Default value 0.0 will be used.");
return "0.0";
} else {
..
Q: Could you possibly change this behavior to permit null values in pe:inputNumber and a neutral display when the value is null, instead of 0.0 ?