Page 1 of 1

pe:inputNumber does not respect required="false" forces 0.0

Posted: 06 Aug 2012, 22:48
by webel
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:

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 {
..
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 ?

Re: pe:inputNumber does not respect required="false" forces

Posted: 07 Aug 2012, 10:00
by Oleg
If you think it's an issue, please create an issue ticket http://code.google.com/p/primefaces-ext ... ssues/list, I will assign it to the responsible person. Thanks.

P.S. I think a similar issue was in p:spinner in the past.

Re: pe:inputNumber does not respect required="false" forces

Posted: 08 Aug 2012, 05:40
by webel