InputNumber with type ="number" doesn´t work

UI Components for JSF
Post Reply
rafaelhnakano
Posts: 5
Joined: 27 Oct 2013, 23:40

11 Jul 2017, 20:47

Hey guys,

Anyone knows how can I use <p:inputNumber with type ="number" ?

I need to use a web application on a tablet and open a numeric keybord, but when I put type="number" my ajax event doesn´t work and I can´t include any decimal values, even my inputNumber configure to to this.

My Code:

Code: Select all

<p:inputNumber decimalPlaces="0" decimalSeparator="," thousandSeparator="." id="comprakg" value="#{registroVisitaDetalheController.vo.vendaCompraKg}"
title="Incluído no dia da visita(Retira do Pedido de venda)" styleClass="centralizar" type="number">
	<p:ajax event="blur" listener="#{registroVisitaDetalheController.calcularPrecoCompra}" update=":form:precoCompra" process=":form"/>
</p:inputNumber>
One thing I've note, In Firefox browser console, when the page is loaded this error appear:

The input type "number" is not supported by autoNumeric()

Thanks Alot!
Bye!

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

11 Jul 2017, 21:04

As the error already says, it's not supported by the JS plugin we use.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

rafaelhnakano
Posts: 5
Joined: 27 Oct 2013, 23:40

11 Jul 2017, 21:11

Thank´s for you reply Thomas Andraschko.

But, why the element inputNumber has a type option if it doesn´t work?

Set type = "number" isn´t possible is any input element of primefaces?

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

11 Jul 2017, 21:42

No idea why it has it.
A better way is to try things instead of asking ;) p:inputText with type=number should work fine.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

rafaelhnakano
Posts: 5
Joined: 27 Oct 2013, 23:40

11 Jul 2017, 22:22

I´ve already tried with InputText, but in this case I´ve lost the formating of InputNumber, because I´m from Brazil and the decimal and thousant sepator are different.

But ok, I´ll use InputText, and some JS to change decimal separator.

This post was to find a easier answer to use InputNumber with type="number", as I said the element has a option, so why doesn´t work?

Anyway, thank you very much for you reply.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 47 guests