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

Community Driven Extensions Project
Post Reply
webel
Posts: 87
Joined: 18 Sep 2010, 09:29
Location: Sydney, Australia
Contact:

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:

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 ?
Primefaces 6.1
JSF Mojarra 2.3.0
(Netbeans 8.2+Glassfish 4.1.1 OR Payara 4.1)
Mac OS X "Yosemite" 10.10.5 / Linux CentOS 6.7

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

07 Aug 2012, 10:00

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.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

webel
Posts: 87
Joined: 18 Sep 2010, 09:29
Location: Sydney, Australia
Contact:

08 Aug 2012, 05:40

Primefaces 6.1
JSF Mojarra 2.3.0
(Netbeans 8.2+Glassfish 4.1.1 OR Payara 4.1)
Mac OS X "Yosemite" 10.10.5 / Linux CentOS 6.7

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests