This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes validateDoubleRange - dynamic min and max attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "validateDoubleRange - dynamic min and max attributes" Watch "validateDoubleRange - dynamic min and max attributes" New topic
Author

validateDoubleRange - dynamic min and max attributes

J Haley
Ranch Hand

Joined: Jul 22, 2004
Posts: 66
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

Joined: May 29, 2008
Posts: 21
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.


A S
J Haley
Ranch Hand

Joined: Jul 22, 2004
Posts: 66
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validateDoubleRange - dynamic min and max attributes
 
Similar Threads
Backing Bean Behaviour on MyFaces using A4J
Number formatting in text input
problem with value attribute of inputText
confused in converter
float conversion error with f:convertNumber