0

I would like to know is possible to develop half rating and quarter rating using primefaces rating? i.e 2.5 , 2.25, 2.75

When i try with double value it throws an error.

Servlet.service() for servlet Faces Servlet threw exception: java.lang.NumberFormatException: For input string: "2.5"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) [rt.jar:1.7.0]
at java.lang.Integer.parseInt(Integer.java:492) [rt.jar:1.7.0]
at java.lang.Integer.valueOf(Integer.java:582) [rt.jar:1.7.0]
at org.primefaces.component.rating.RatingRenderer.encodeMarkup(RatingRenderer.java:72) [primefaces-3.5.7.jar:]
at org.primefaces.component.rating.RatingRenderer.encodeEnd(RatingRenderer.java:48) [primefaces-3.5.7.jar:]

it is only accepting Integer values. How to fix this issue? http://www.primefaces.org/showcase/ui/rating.jsf PF 3.5.11 jboss 7 myfacess

Rajesh Dhiman
  • 1,888
  • 1
  • 17
  • 30
Godwin Thaya
  • 35
  • 1
  • 9
  • 1
    It's not an issue. Rating accepts only `Integer` values, so it could be considered as a future improvement. For your case you'll probably need to implement your own solution, think about an input text or a spinner. If you want to have star pics, you'll probably need to try your own images with some JS code. – Aritz Feb 22 '14 at 12:01
  • Yes i am also thinking of the same workaround but can you confirm if half , quarter and 3/4 rating is available soon in PF? – Godwin Thaya Feb 22 '14 at 13:03
  • Extending rating renderer and decalring it in faces-config should be sufficient – Michele Mariotti Feb 22 '14 at 14:40

0 Answers0