Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validateDoubleRange - dynamic min and max attributes

 
J Haley
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�m trying to use validateDoubleRange with an inputText. I seem to have a problem when the minimum and maximum ranges are pulled from my bean. I think I should be able to get around this by using a binding attribute with f:validateDoubleRange. I�m not clear on how to this.

Works, but I need to build min and max dynamically


Does not work. Thinks range is from 0 to 0


Think this may work, but not clear on how binding method in bean would look.
 
Arun Sudharsanam
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider this part of code:

<h:inputText value="#{quote.amount}" required="true"><f:validateDoubleRange minimum="#{bean.min}" maximum="#{bean.min}" ></f:validateDoubleRange></h:inputText>


You have coded minimum and maximum with same bean variables.
Dont know whether its a typo error or its how you have implemented.
 
J Haley
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was a typo. My min and max values are pointing to different bean values. I guess my main question is how to do this with a binding.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic