Unable to paste the context in Primefaces Extension pe:inputNumber using mouse
Asked Answered
N

2

2

We've been using Primefaces (v 3.5) and Primefaces Extensions (v 0.7.0) in our project and it's been great, cheers for the developers and community!

The inputNumber component takes care of pretty much all of our needs when dealing with decimal fields.

The one thing that isn't working is when the user paste a value into the field using the mouse right button then paste option.

When that happens, it seems these values aren't processed, since when I submit the form they are cleared, no matter it's a valid or unvalid value.

The user can even paste a text into the pe:inputNumber. The control c + control v works as expected, no problem at all.

The code we are using is like this:

 <pe:inputNumber id="AmtInTxt" value="#{myController.amtField}" symbol="$ "/>

Any ideas of how can we make the context menu paste works like the control c + control v?

Community Post

Nardoo answered 5/11, 2014 at 15:27 Comment(0)
T
1

Was this ever solved? For future viewers - this looks like an issue with not posting the data to the bean when using the mouse. Try putting an ajax event handler in your input field.

<pe:inputNumber ...> <p:ajax event="blur"/> </pe:inputNumber>

Termagant answered 12/3, 2015 at 18:26 Comment(0)
H
0

I've encountered same problem. At first I thought it happens only when using browser's autocomplete feature. From this post I've learned that it is strictly connected with just changing value via mouse. I am using <p:ajax event="blur" process="@this" /> and it doesn't change anything. More specifically, the value is empty within the InputNumberRenderer.getConvertedValue method and since then it passes null value to setter/listener.

EDIT: Also tried putting onstart="$(event.target).keypress()" within the ajax to simulate user's keypress. Sadly doesn't work.

Hoopla answered 30/8, 2016 at 14:27 Comment(2)
How is this an answer to the questionAstoria
It's just another hint for future viewiers. I thought it might be helpful. Eventually I had to abbandon this component.Hoopla

© 2022 - 2024 — McMap. All rights reserved.