I have a PrimeFaces slider with an associated inputText. Everything is working fine, except I can´t find a way of formatting the inputText value. I want the inputText to show and get values in currency format.
What I've tried so far:
- Changing the
p:inputText
with ape:inputNumber
component: causes an exception because the value can't be set (slider simply doesn´t work with inputNumber); - Setting the
p:slider
target to ah:inputHidden
component with the same value thanp:inputText
(with af:convertNumber
attached to): works when changing values through slider, but when using inputText to change the value slider doesn´t update (throws an UpdateModelException behind the scenes);
Update: it was found later that the second option exception is thrown because f:convertNumber
expects a number type bean property, not an integer one. Both solutions shown below work around this issue.
Is there a simple way of doing this without using jQuery?
Thanks!
Filipe
inputText
? You can achieve this usinginputHidden
anddisplay
attribute ofslider
– giaffa86InputText
you can achieve this using anoutputText
as shown in Primefaces Showcase. – giaffa86