This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Converter + Validation - scaling mismatch  RSS feed

Dowell Griffin
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am somewhat of a newbie to JSF.

If I have a converter that scales by 100ths (entry in seconds, stores in 100ths of seconds) I have to use the x100 value in the ranges for the converter. So, when an invalid entry occurs the default message shows the scaled ranges which is wrong.

<h:inputText converter="IntToFloat100thsConverter"
<f:validateLongRange minimum="100" maximum="25500"/>

The user enters 1 - 255 but the validation message says 100 - 25500. I know I can use validatorMessage="1 - 255" but this seems so common I am wondering if there is a better solution I am overlooking. Comments?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!