Workaround for inputNumber listener bug

Community Driven Extensions Project
Post Reply
faldric
Posts: 8
Joined: 25 Apr 2016, 13:59

25 Apr 2016, 16:50

Is there any known workaround for https://github.com/primefaces/primefaces/issues/1114 on Primefaces extensions 4.0.0?

Whenever I add an onKeyUp listener to an inputNumber tag, the listener always skips the first input and is always one input behind.

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

25 Apr 2016, 17:10

nope - you would have to overwrite the js.
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

faldric
Posts: 8
Joined: 25 Apr 2016, 13:59

25 Apr 2016, 17:40

Thx for the answer.

Can I do this in a reasonable way without building my own patched jar file? The fix in the listed bug changes the init method so I guess (document).ready() is to late to overwrite the function?

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

25 Apr 2016, 17:53

1) take the js from the last PFE release
2) check the commits in PF of inputNumber fixes
3) apply these fixes on the old PFE js
4) include the js in the h:head last facade
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

faldric
Posts: 8
Joined: 25 Apr 2016, 13:59

25 Apr 2016, 19:30

Took me some time but got it to run. Thx for the help.

If somebody stumbles over the same problem. I had to do the following with version 4.0.0
1) Just copy paste the JS version linked in the bug ticket. Replace PrimeFaces with PrimeFacesExt and be sure the js file gets loaded after the initial primefaces extension js.
2) Register a custom renderer in your faces config in which you replace the encodeInput methods.

kind regards

everon25quanthanh
Posts: 4
Joined: 25 May 2016, 19:03
Contact:

26 May 2016, 19:37

check the commits in PF of inputNumber fixes

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests